Reputation: 1313
I am trying to get OpenGL and Glut running on Eclipse Linux FC13.
After spending two days on it, I admit that help is needed. On FC13 Eclipse, I see
/usr/include/GL
and /usr/include/SDL
-- so the libs are there. I started Eclipse, and then tried to run a simple program on it, just like suggested here. However, two things were missing in those steps:
When trying to run the program, I see this error:
Program does not exist
and sometimes
Binary not found
If I just run the "hello world" it works, but otherwise, those errors happen every time I try to include glut gl or sdl commands.
Here is an excerpt from the compiler error:
make all
g++ -O2 -g -Wall -fmessage-length=0 -c -o tw.o tw.cpp
tw.cpp: In function ‘void main_loop_function()’:
g++ -o tw tw.o
Yes, apparently the compiler is not able to see the glu, gl, sdl and glut libraries.
Some suggestion on how to fix?
Upvotes: 0
Views: 1456
Reputation: 15656
You have to tell the compiler that your program uses additional libraries.
Use the -l argument
g++ -O2 -g -Wall -fmessage-length=0 -lglut -lGL -lGLU -lX11 -c -o tw.o tw.cpp
This should help against unsatisfied link errors.
You can set these in the properties of your Project. Properties->c/c++ Build->Settings->Tool Settings->Linker
Upvotes: 2
Reputation: 111120
Check if the compiler is able to find the appropriate header files or not. If not, you are sure to get compiler errors. Try using the -I
option to set the appropriate paths.
Once you've fixed that, check if there are any linker errors (undefined symbols/references or the sort). If you do: Try to set the library paths using the -L
option and ask the compiler to link in the specific libraries by using the -l
option. Note that the latter expects something like -lmath
where in reality the library being linked in is actually called libmath.so
or libmath.a
(as the case may be).
Upvotes: 1