On Oct 29, 2010, at 7:46 AM, Elias Breunig wrote:
I just did the code without any classes stuf, so just plain procedural
and it didn't throw any errors.
So it seems like I can not pass the reference to the objective
function the right way when i use everything in a class.
This is a standard C++ thing: you cannot pass pointers to member
functions as callback routines, unless the member functions are
static. See:
http://www.parashift.com/c++-faq-lite/pointers-to-members.html
The right way to do it is to pass a pointer to your SurfLocater object
as the void* parameter, do a typecast inside your function to get back
an object pointer, and then call whatever member function you want.
Steven
_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss