I’m trying to compile a project, but I receive the following error:
In file included from monitor/gfx/field.h:14,
from monitor/gfx/termapi.h:18,
from monitor/gfx/termapi.cpp:16:
monitor/gfx/glfont.h:8:31: error: GL/gl.h: No such file or directory
monitor/gfx/glfont.h:9:33: error: GL/glu.h: No such file or directory
monitor/gfx/termapi.cpp:20:30: error: GL/glx.h: No such file or directory
I have the following installed:
freeglut3-dev
libglu1-mesa-dev
libglu1-xorg-dev
I do compile with “-lglut -lGL -lGLU”. I’ve tried to also add “-Iusr/include” but then I instead get:
In file included from /usr/include/features.h:388,
from /home/poltech/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/include/c++/4.3.3/arm-none-linux-gnueabi/bits/os_defines.h:44,
from /home/poltech/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/include/c++/4.3.3/arm-none-linux-gnueabi/bits/c++config.h:40,
from /home/poltech/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/include/c++/4.3.3/cstring:48,
from cfg/group_cfg.cpp:13:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
And if I instead add “-Iusr/include/GL”, and change the includes from <GL/gl.h> to “<gl.h>” I get:
In file included from monitor/gfx/glfont.h:8,
from monitor/gfx/field.h:14,
from monitor/gfx/termapi.h:18,
from monitor/display.cpp:23:
/usr/include/GL/gl.h:2085:22: error: GL/glext.h: No such file or directory
In file included from monitor/gfx/glfont.h:9,
from monitor/gfx/field.h:14,
from monitor/gfx/termapi.h:18,
from monitor/display.cpp:23:
/usr/include/GL/glu.h:38:19: error: GL/gl.h: No such file or directory
I don’t know what to do to get pass this. Can anyone help me?
I have the following installed:
freeglut3-dev
libglu1-mesa-dev
libglu1-xorg-dev[/quote]
This is all fine. Do this:
ls -l /usr/include/GL
This will show you what GL files you have installed. /usr/include is searched by default by the compiler, which is why <GL/gl.h> is what you put in source files.
I do compile with “-lglut -lGL -lGLU”. I’ve tried to also add “-Iusr/include” but then I instead get:
You’re missing a leading slash on /usr/include. Also, you should not have to add this is an include path because the compiler uses this by default. Now you can make it “not” search this path by adding the -nostdinc arg to the compiler, but you probably don’t want to do that.
First, verify that gl.h and glext.h exist in /usr/include/GL. If so, then let’s see the full command you are using to invoke the compiler. Also, is this the compiler that was built/installed on your system by default, or did you build a custom compiler (gcc)?
I can add that I have not written the Makefile (or the code), I’ve just overtaken this project and is trying to compile it before I start editing the source code.
Are you trying to cross-compile an OpenGL program?
If so, you need to either cross-compile all of the libraries which it uses, or install pre-compiled versions for the appropriate target platform, and tell the compiler to use those.
Installing x86 (or x86-64 or whatever the host system is) packages won’t help you. Similarly, adding -I/usr/include won’t help (and may make things worse), because those files are for the host platform, not the target platform.
You can get the source code for an OpenGL library (Mesa), but that may not work on the target platform, which may require a specific OpenGL library from the hardware vendor.
None of this really has much to do with OpenGL per se. You’d probably be better off seeking a forum dedicated to whichever platform you’re targeting.
Ok, sounds resonable when you say it… Where can I find pre-compiled versions? And how do I know which is the approriate platform?
(As you probably understand by my utterly silly questions, I’m a complete newbie to linux programming and OpenGL…)
Which system are you trying to generate an executable for? Android? It’s some form of ARM-based system (that much is obvious from the fact that the C++ compiler is called “arm-none-linux-gnueabi-g++” rather than just “g++”).
If you were expecting it to run on a PC (x86 or x86-64), you should first find out if the program will actually run on one (ask whoever you got it from; we don’t know).