The function was only added to the VAPI recently, I believe you'll need version 0.22.0 of Vala (or one of the unstable 0.21.x releases).
To get around this you can create a local binding in your code:
[CCode (cname = "g_get_num_processors")]
private extern static uint get_num_processors ();