If I attempt to use a project using the C++ compiler, I get errors spit out from any use of cog_run with any variety of function I try. Standard functions, static class functions, extern "C" wrapped functions. All produce the error:
error: invalid conversion from void (*) () to void (*) (void*) [-f permissive]
error: initializing argument 1 of 'int* cog_run(void(*)(void*), int) [-fpermissive]
naturally, putting in -fpermissive in compiler options converts these from errors to warnings but that doesn't mean it's going to work. This error will happen to any C++ project I start even the simple examples from the multicore folder.
Is that part of the library a bust for C++ projects? Do I just have to live with the warnings.
As my ugly workaround to calling a class member function in a C callback I created a global variable that I store the object I want to launch into. In the class header is standard function with no return value or parameters like this
Calling that function like thus:
g_p_object_to_launch = &myObject;
should callback that function which does:
and the run() method then gets everything setup I/O wise and begins running an endless loop.
Also, if the function that is run by cog_run() terminates under some condition, does the cog get stopped? I would assume so, but the description doesn't specify.