User forums > Using Code::Blocks
cannot find -lglut32.lib
devGod:
Good day,
I'm having some trouble compiling/running some OpenGL code.
I've followed these steps:
http://www.mingw.org/MinGWiki/index.php/Glut
I have all the files, but I'm not completely sure if I put them in the right dirs. :oops:
glut32.dll in CodeBlocks\bin
glut.h in CodeBlocks\include\GL
glut32.lib in CodeBlocks\lib
I got up till the point that I recieved this error when compiling:
--- Quote ---E:\TEMP/ccMMoggb.o(.text+0x1c):t10.c: undefined reference to `__glutInitWithExit@12'
E:\TEMP/ccMMoggb.o(.text+0x3e):t10.c: undefined reference to `__glutCreateWindowWithExit@8'
E:\TEMP/ccMMoggb.o(.text+0x60):t10.c: undefined reference to `__glutCreateMenuWithExit@8'
If these are the only three undefined references then you probably linked with -lglut32 instead of glut32.lib.
--- End quote ---
So I tried playing with the glut32.lib in the linker.
Now I don't get the errors anymore. Instead I get 'cannot find -lglut32.lib'.
BTW, I'm trying to start out with the code example given in this topic:
http://forums.codeblocks.org/index.php?topic=2656.0
Build Log:
--- Quote ---Switching to target: default
Linking executable: D:\Documenten\Workspace\CodeBlocks\Project1\OpenGL.exe
C:\Program Files\CodeBlocks\bin\..\lib\gcc\mingw32\3.4.4\..\..\..\..\mingw32\bin\ld.exe: cannot find -lglut32.lib
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings
--- End quote ---
tiwag:
you need to add the directory where the linker has to look for the library
check Project->Build Options->Directories->Linker
devGod:
If I add 'C:\Program Files\CodeBlocks\lib' to the list I still get the error. :(
-[EDIT]-
Sorry, forgot the trailing slash...
Now when I try to debug I get a compile error:
Build Log:
--- Quote ---Switching to target: default
Linking executable: D:\Documenten\Workspace\CodeBlocks\Project1\OpenGL.exe
mingw32-g++.exe: Files\CodeBlocks\lib -o D:\Documenten\Workspace\CodeBlocks\Project1\OpenGL.exe .objs\main.o -lopengl32 -lglu32 -lgdi32 -luser32 -lkernel32 -lglut32.lib -mwindows: No such file or directory
mingw32-g++.exe: no input files
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
--- End quote ---
Debugger
--- Quote ---Selecting target: default
Compiling: failed
Aborting debugging session
--- End quote ---
nova:
hmm, I'd suggest you try using Filemon from sysinternals (google it) to see what it says about what cannot be found.
get regmon sometime too, also useful, but probably not for this matter.
if filemon spams you too much you could try filtering its output ( control+l )
nova
Rockeye:
It seems that you haven't write it correctly. As far as i remember, when you specify a library, there 2 different ways :
1) you link the file "glut32.lib"
OR
2) you add the command "-lglut32" which automaticaly search for glut32.lib
That your compiler says :
--- Quote ---cannot find -lglut32.lib
--- End quote ---
It is looking for the file "-lglut32.lib" on your filesystem, which of course doesn't exist...
Choose one of the possibility, but not both. That should solve your error...
Navigation
[0] Message Index
[#] Next page
Go to full version