
On 6/30/06, Stephen Torri
On Fri, 2006-06-30 at 11:04 -0700, Cory Nelson wrote:
What I am getting back from the g++ compiler is the following error message:
error: cannot convert `boost::function
' to `void (*)()' for argument `1' to `void glutDisplayFunc(void (*)())' Any ideas where I am going wrong?
You are passing a function object to a C function which expects a function pointer. A boost::function can not be converted into a function pointer.
I appreciate the response pointing out the error. It would be nice to have a solution and not just a critique.
Glut was poorly designed in that respect (not giving an option to pass a user data pointer) - in this case there is no solution other than making your function object global and have a C function which calls it. You could always modify your glut source, it sounds like an easy enough patch.
Stephen
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Cory Nelson http://www.int64.org