Hello Bourgond,
I added the compiler options to the place you mentioned, but my IDE gives an error:
-------------- Clean: Debug in Test_OpenGL (compiler: GNU GCC Compiler)---------------
Cleaned "Test_OpenGL - Debug"
-------------- Build: Debug in Test_OpenGL (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -g -ID:\freeglut\include -c "D:\Codeblock C files\Test_OpenGL\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe -LD:\freeglut\lib -o bin\Debug\Test_OpenGL.exe obj\Debug\main.o -lOGL -lGL -lgl -lglut32 -lopengl32 -lglu32 -lwinmm -lgdi32
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot find -lOGL
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot find -lGL
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot find -lgl
Other information that might be usefull, after seing the error:
My glut / freeglut folder is located in D:\freeglut, containing the folders:
- include
- lib
Looks like the IDE is searching in the wrong directory.... is that correct and what can I do?
Edit: wait a minute..... Looks like this might be part of the solution:
http://www3.ntu.edu.sg/home/ehchua/programming/opengl/HowTo_OpenGL_C.html
I must honestly say....OpenGL setup is really difficult and not well documented....
So many bits and pieces scattered around Internet-net...
Of course, that might be my problem, lacking proper searching skills??
Trying the suggestion in the link... in the meantime, if there is more to know about it, that I should know, post please. thanks...
Edit:
-- download the MingW package as mentioned.
http://www.transmissionzero.co.uk/software/freeglut-devel/
-- Both mingW package readme.txt and website link mention that I have to copy the just unpacked folders to MingW:
Because My Codeblocks+MingW package has installed everything already I copy the files
to the existing folders:
- C:\MinGW\freeglut\lib
- C:\MinGW\freeglut\include
-- Trying to compile: no change, same errors
-- trying the compiler switches mentioned in the MingW package from Transmissionzero
read me. I added the following switches to Codeblocks project build options, linker settings:
-D FREEGLUT_STATIC -I"C:\MinGW\freeglut\include"
-L"C:\Program Files\Common Files\MinGW\freeglut\lib"
-lfreeglut_static
-lopengl32
-lwinmm
-lgdi32
-Wl,--subsystem,windows
Results: errors decreased to 8 and as follows:
obj\Debug\main.o||In function `Z11RenderScenev':|
D:\Codeblock C files\Test_OpenGL\main.cpp|168|undefined reference to `m3dGetPlaneEquation(float*, float const*, float const*, float const*)'|
D:\Codeblock C files\Test_OpenGL\main.cpp|169|undefined reference to `m3dMakePlanarShadowMatrix(float*, float const*, float const*)'|
D:\Codeblock C files\Test_OpenGL\main.cpp|234|undefined reference to `m3dGetPlaneEquation(float*, float const*, float const*, float const*)'|
D:\Codeblock C files\Test_OpenGL\main.cpp|235|undefined reference to `m3dMakePlanarShadowMatrix(float*, float const*, float const*)'|
obj\Debug\main.o||In function `Z7SetupRCv':|
D:\Codeblock C files\Test_OpenGL\main.cpp|268|undefined reference to `gltLoadTGA(char const*, int*, int*, int*, unsigned int*)'|
D:\Codeblock C files\Test_OpenGL\main.cpp|278|undefined reference to `gltLoadTGA(char const*, int*, int*, int*, unsigned int*)'|
D:\Codeblock C files\Test_OpenGL\main.cpp|288|undefined reference to `gltLoadTGA(char const*, int*, int*, int*, unsigned int*)'|
D:\Codeblock C files\Test_OpenGL\main.cpp|298|undefined reference to `gltLoadTGA(char const*, int*, int*, int*, unsigned int*)'|
||=== Build finished: 8 errors, 0 warnings (0 minutes, 1 seconds) ===|