User forums > Help

ld.exe cannot find -lfreeglut

<< < (5/5)


I appear to have misled you. I did not edit either file using CB but used notepad as you suggested.
Here are excerpts copied from my files as modified:
(1) The Wizard file:
// add link libraries
    else if (PLATFORM == PLATFORM_MAC)
(2) The glut.cbp file:
   <Add directory="$(#glut.include)" />
         <Add library="freeglut" />
         <Add library="glu32" />
         <Add library="opengl32" />
         <Add library="winmm" />
         <Add library="gdi32" />
         <Add library="user32" />
         <Add library="kernel32" />
         <Add directory="$(#glut.lib)" />
      <Unit filename="main.cpp">
Re my comment- of course one doen't edit a cbp file in CB one opens a cbp file and then can edit the source file cpp.
 However, my original problem remains. If I try to use the GLUT wizard to write a test program the compiler complains that it cannot locate glut32 and I cannot proceed. Again, if I try the console wizard I get the error message that started this thread.

Well it looks as if I'm back in business although I'm not totally sure why !!
Step (1): Changed the Global Settings , Other Settings, compiler loging entry to Full...
              This enabled Console applications to compile and run. However, the testing program still would not work for glut application. Message came up to the effect that path seemed to be correct but still could not find glut32.lib .

Step (2): Downloaded the glut32.lib and put it in the MinGW\lib directory and everything works !

Seems to me that the wizard is still not updated fully OR perhaps the demo program needs to be updated ??
Anyway thanks to all who tried to help - now I can return to learning modern openGL programming.

Hi Jack
I read your tutorial carefully when I run the sample GLUT project I get this error:
ld.exe cannot find -lfreeglut

I am using C::B 10.05, freeglut freeglut-MinGW-2.8.0-1, Windows7 64bit on DELL laptop with NVIDIA GeForce GT525M graphic card.

I have also did these:
1. Download this version (codeblocks-10.05-setup.exe)
2. Download this file(tdm64-gcc-4.6.1.exe)
3. check this settings in Compiler setting:
    C complier:                    x86_64-w64-mingw32-gcc.exe
    C++ complier:                 x86_64-w64-mingw32-g++.exe
    Linker for dynamic libs:     x86_64-w64-mingw32-g++.exe

Please advise


On Win10 64bit. Unzip CB. With MinGW. Put header files from freeglut package under mingw/include. Put libraries from freeglut package under mingw/lib. I suppose the 64bit versions are relevant on a 64bit system. Put the 64bit version of freeglut.dll (from the bin directory of the package) under c:\windows\syswow64, so its available systemwide. Edit the project and wizard scripts for 'glut' project of CB. Specify the mingw subdirectory as the location for freeglut, once intending to create a project and asked to do so by the CB project wizard. However: cannot find -lfreeglut (still).
To the point: put 'lib/freeglut.lib' from the _MSVC_ package under 'mingw/lib' and the linker error will go away.

Seems mingw's library builds do not taste for gcc ? Packages messed up ? Is the mingw library not compatible with the msvc one ?

P.S. I know it's outdated topic, but that was the newest info on howto opengl under windows and those r my conclusions/questions. Regards.

Please do not post to old threads!

Please do not tell someone to put files under the compiler installation folder!
It is not wise or smart thing to do.

Please learn how to use Code::Blocks global variables to point to folders that contain third party libraries.

Tim S.


[0] Message Index

[*] Previous page

Go to full version