libTheora on Linux error message:

BlitzMax Forums/Brucey's Modules/libTheora on Linux error message:

Russell(Posted 2014) [#1]
The theora player module works great on Windows (once I finally got the correct mingw issues worked out), but when I go to compile it on Linux I get: "TheoraUtil.cpp:38:31: error: usleep() was not declared in this scope" and it highlights this section of code in 'TheoraUtil.cpp':

.... some other stuff

void _psleep(int milliseconds)
{
#ifndef _WIN32
    usleep(milliseconds * 1000);
#else
	Sleep(milliseconds);
#endif
}


Any ideas? (Also, why does the non-Win32 version multiply milliseconds by 1000? Is it actually MICROseconds, and needs to be multiplied by 1000 to equal millisecs?)

Thanks for any help!
Russell


skidracer(Posted 2014) [#2]
add a #include <unistd.h> at top of file should work


Derron(Posted 2014) [#3]
Yes, usleep uses microseconds.


bye
Ron


Russell(Posted 2014) [#4]
That helped, but now I get
"TheoraVideoFrame.cpp"
"memset was not declared in this scope" and
"memcpy was not declared in this scope".

Perhaps this is an argument against having 5000 different header files spread out over 20 directories? :/

Anyway, I just need to know what to include...

Thanks!
Russell


markcw(Posted 2014) [#5]
Memset/memcpy need string.h see here.


Russell(Posted 2014) [#6]
Thanks, that got me a little further, but it still complains:
ogg/ogg.h: No such file or directory
# include <ogg/ogg.h>

Ho hum...

Russell


markcw(Posted 2014) [#7]
That's strange, there is no reference to ogg.h in my copy. Are you using the latest svn version from googlecode?

Edit: There doesn't seem to be a zip so you must be.

Edit: Right, you must be missing a dependency. You need to install libogg-dev on ubuntu to get /usr/include/ogg/ogg.h.

Edit: this is a list of dependencies for bah modules I made. It shows you need oggvorbis.mod for TheoraPlayer and thus also need to install libvorbis-dev on ubuntu.