Rename "exit_event" to something else. If I remember right there is already a function "exit_event" in the PhysX header that would be then overwritten by your function.