"O_RDONLY"、"F_SETFL"'O_NONBLOCK'遵循 OpenGL 教程时未声明的错误

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

本文关键字:教程 未声明 错误 OpenGL 遵循 SETFL RDONLY NONBLOCK      更新时间:2023-10-16

我目前正在以下网站学习现代OpenGl:http://www.arcsynthesis.org/gltut/Building%20the%20Tutorials.html.

不幸的是,当我按照说明构建代码示例时,我失败了。

这就是发生的事情:

1-我在glsdk目录中运行premake4代码块

2-我在代码块中打开glsdk.workspace

3-我进入构建->构建工作区。

4-我得到错误:

/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) ===|

我目前正在运行Ubuntu 14.04。帮我解决这个问题。

我终于实现了这一点,我所做的是使用gmake平台,然后转到生成的*.make文件,在以LIBS开头的行末尾添加了-lx11,用于调试和发布选项。最后,只需运行makeconfig=debugconfig=release即可获得可执行文件。此外,如果您有多个*.make文件,请将-lX11添加到所有文件中。