So I decided to build OIS 1.3 from source, and can't figure out why it's not compiling.
http://sourceforge.net/projects/wgois/
I did the usual procedure with:
./bootstrap
./configure
make
And get the following error:
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../includes -I../includes -g -O2 -I/usr/X11R6/include -I/home/alex/Documents/c++/dep/include -g -O2 -MT LinuxJoyStickEvents.lo -MD -MP -MF .deps/LinuxJoyStickEvents.Tpo -c ./linux/LinuxJoyStickEvents.cpp -fPIC -DPIC -o .libs/LinuxJoyStickEvents.o
./linux/LinuxJoyStickEvents.cpp: In member function 'virtual void OIS::LinuxJoyStick::capture()':
./linux/LinuxJoyStickEvents.cpp:100:77: error: 'read' was not declared in this scope
int ret = read(mJoyStick, &js, sizeof(struct input_event) * JOY_BUFFERSIZE);
^
./linux/LinuxJoyStickEvents.cpp: In static member function 'static OIS::JoyStickInfoList OIS::LinuxJoyStick::_scanJoys()':
./linux/LinuxJoyStickEvents.cpp:275:13: error: 'close' was not declared in this scope
close(fd);
^
./linux/LinuxJoyStickEvents.cpp:283:12: error: 'close' was not declared in this scope
close(fd);
^
./linux/LinuxJoyStickEvents.cpp: In static member function 'static void OIS::LinuxJoyStick::_clearJoys(OIS::JoyStickInfoList&)':
./linux/LinuxJoyStickEvents.cpp:294:20: error: 'close' was not declared in this scope
close(i->joyFileD);
^
make[1]: *** [LinuxJoyStickEvents.lo] Error 1
make[1]: Leaving directory `/home/alex/Documents/c++/packages/ois-v1-3/src'
make: *** [all-recursive] Error 1
The code in question is here:
//We are in non blocking mode - we just read once, and try to fill up buffer
input_event js[JOY_BUFFERSIZE];
while(true)
{
int ret = read(mJoyStick, &js, sizeof(struct input_event) * JOY_BUFFERSIZE);
if( ret < 0 )
break;
What on earth is this "read" function and where did it come from? There are counterpart "write" functions with the same signatures, and I don't have the faintest idea of where they even come from...
Any help?