BelaPlatform / libpd

Pure Data embeddable audio synthesis library
http://libpd.cc
Other
3 stars 2 forks source link

undefined reference to sys_microsleep() #2

Open giuliomoro opened 6 years ago

giuliomoro commented 6 years ago

@peter2708 https://github.com/libpd/libpd/issues/136#issuecomment-361581784

Has there been a change with the most recent bela os....

I'm getting linking errors such as: /root/Bela/projects/bela_workshop/libpd-render-with-IMU.cpp:(.text+0x784): undefined reference to `sys_microsleep(int)'

We have tried with and without the libpd prefix before sys_microsleep.

Have a look at the most recent BelaPlatform/Bela core/default_libpd_render.cpp: the i/o loop is already in there, so you should not need to handle it separately in your render file.

#ifdef PD_THREADED_IO
void fdLoop(void* arg){
    t_pdinstance* pd_that = (t_pdinstance*)arg;
    while(!gShouldStop){
        sys_doio(pd_that);
        usleep(3000);
    }
}
#endif /* PD_THREADED_IO */

You may also be able to rescue your current render.cpp by declaring sys_microsleep() with C linkage:

extern "C"
{
void sys_microsleep(int);'
};
giuliomoro commented 6 years ago

incidentally, if that libpd-render-with-IMU.cpp was taken from this, then this has already been updated!