fYre
fYre

Reputation: 1300

'O_RDONLY', `F_SETFL`, 'O_NONBLOCK' undeclared errors while following OpenGL tutorial

I am currently learning modern OpenGl from the following website: http://www.arcsynthesis.org/gltut/Building%20the%20Tutorials.html.

Unfortunately, when I follow the instructions to build the code examples, I fail.

This is what happens:

1- I run premake4 codeblocks in the glsdk directory.

2- I open glsdk.workspace in code blocks.

3- I go to Build -> Build workspace.

4- I get the error:

/home/hani/Desktop/Tutorial 0.3.8/glsdk/freeglut/src/freeglut_joystick.c In function ‘fghJoystickOpen’:|

/home/hani/Desktop/Tutorial 0.3.8/glsdk/freeglut/src/freeglut_joystick.c|1430|error: ‘O_RDONLY’ undeclared (first use in this function)|

/home/hani/Desktop/Tutorial 0.3.8/glsdk/freeglut/src/freeglut_joystick.c|1430|note: each undeclared identifier is reported only once for each function it appears in|

/home/hani/Desktop/Tutorial 0.3.8/glsdk/freeglut/src/freeglut_joystick.c|1448|error: ‘F_SETFL’ undeclared (first use in this function)|

/home/hani/Desktop/Tutorial 0.3.8/glsdk/freeglut/src/freeglut_joystick.c|1448|error: ‘O_NONBLOCK’ undeclared (first use in this function)|

/home/hani/Desktop/Tutorial 0.3.8/glsdk/freeglut/src/freeglut_joystick.c||In function ‘fghJoystickInit’:|

/home/hani/Desktop/Tutorial 0.3.8/glsdk/freeglut/src/freeglut_joystick.c|1597|error: ‘F_OK’ undeclared (first use in this function)|

||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

||=== Build: Debug in glload (compiler: GNU GCC Compiler) ===|
||=== Build: Debug in glimg (compiler: GNU GCC Compiler) ===|
||=== Build: Debug in freeglut (compiler: GNU GCC Compiler) ===|

I am currently running Ubuntu 14.04. Help me solve this problem.

Upvotes: 2

Views: 6685

Answers (1)

fYre
fYre

Reputation: 1300

I finally got this to work, what I did was use the gmake platform instead, then by going to the *.make file generated I added -lx11 at the end of the line that begins with LIBS for both the debug and release options. Finally just run make config=debug and make config=release to get the executable files. Also, if you have multiple *.make files add -lX11 to all of them.

Upvotes: 1

Related Questions