Author Topic: ld.exe cannot find -lfreeglut  (Read 39494 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: ld.exe cannot find -lfreeglut
« Reply #15 on: December 05, 2011, 09:42:29 pm »
@JackDawson.
Yes I did edit the other file (with notepad) – no problems. I don’t quite understand why I can’t edit a cbp file in CB editor however, I did edit the glut.cbp in notepad as you suggest. Now when I try to open glut.cbp using CB I get : SCR1
Now if I press O.K. I get: SCR2
 
Finally , I cannot close this except by pressing  CntrlAltDel and using the task manager.
If instead of messing with the above I try the simple console program “Hello World” I’m back to the error message that I started this thread with.
Don’t know if any of this helps – but I do appreciate the input.

I think you did not really read the tutorial.
It tells you how to modify the glut-template, so it uses freeglut instead of glut.

You should not open the templates cbp-file directly, but create a (free)glut-project with the wizard, that ues the edited cbp-file.

By the way:
you can open a cbp-file (Code::Blocks projectfile) in C::B's editor if you use a recent version (aka nightly build) and open it via the FileManager plugin.
The normal way for C::B is to read the content of a cbp-file and open the project accordingly.

Offline JackDawson

  • Multiple posting newcomer
  • *
  • Posts: 37
Re: ld.exe cannot find -lfreeglut
« Reply #16 on: December 05, 2011, 09:59:07 pm »
Hahaha your the one who encouraged me to make the tutorial.. LMAO
Link or it didn't happen? As far as I can see, I've only told you how to login in the wiki.

http://forums.codeblocks.org/index.php/topic,14967.0.html


This is the link. As I said you encouraged me along with Olly. However if you only "Glanced" at that thread at the time it was being written, I can see why you would think you were only helping with the Wiki. However the way it came across on that thread you were encouraging me to write it as well since that was the Gist of the conversation during that time.

Your killing me with this Glance stuff bro.. lol

Offline JackDawson

  • Multiple posting newcomer
  • *
  • Posts: 37
Re: ld.exe cannot find -lfreeglut
« Reply #17 on: December 05, 2011, 10:02:12 pm »
@JackDawson.
Yes I did edit the other file (with notepad) – no problems. I don’t quite understand why I can’t edit a cbp file in CB editor however, I did edit the glut.cbp in notepad as you suggest. Now when I try to open glut.cbp using CB I get : SCR1
Now if I press O.K. I get: SCR2
 
Finally , I cannot close this except by pressing  CntrlAltDel and using the task manager.
If instead of messing with the above I try the simple console program “Hello World” I’m back to the error message that I started this thread with.
Don’t know if any of this helps – but I do appreciate the input.


I am going to repeat one line you said :

"I don’t quite understand why I can’t edit a cbp file in CB editor however"

I never said edit it in CB. As my tutorial states, you have to use notepad. And you edit both files using notepad.


EDIT : Jens mention something that might be of interest to you :

"You can open a cbp-file (Code::Blocks projectfile) in C::B's editor if you use a recent version (aka nightly build) and open it via the FileManager plugin."
« Last Edit: December 05, 2011, 10:07:10 pm by JackDawson »

Offline JackDawson

  • Multiple posting newcomer
  • *
  • Posts: 37
Re: ld.exe cannot find -lfreeglut
« Reply #18 on: December 05, 2011, 10:04:11 pm »
@JackDawson.
Yes I did edit the other file (with notepad) – no problems. I don’t quite understand why I can’t edit a cbp file in CB editor however, I did edit the glut.cbp in notepad as you suggest. Now when I try to open glut.cbp using CB I get : SCR1
Now if I press O.K. I get: SCR2
 
Finally , I cannot close this except by pressing  CntrlAltDel and using the task manager.
If instead of messing with the above I try the simple console program “Hello World” I’m back to the error message that I started this thread with.
Don’t know if any of this helps – but I do appreciate the input.

I think you did not really read the tutorial.
It tells you how to modify the glut-template, so it uses freeglut instead of glut.

You should not open the templates cbp-file directly, but create a (free)glut-project with the wizard, that ues the edited cbp-file.

By the way:
you can open a cbp-file (Code::Blocks projectfile) in C::B's editor if you use a recent version (aka nightly build) and open it via the FileManager plugin.
The normal way for C::B is to read the content of a cbp-file and open the project accordingly.


You the MAN !! Thank you. I am looking forward to see the Extra Option of FreeGlut in the ICON list. Both the Glut and FreeGlut should be there. I totally agree. I will be looking forward to that in a future version. Thank you thank you thank you.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: ld.exe cannot find -lfreeglut
« Reply #19 on: December 05, 2011, 10:48:44 pm »
JackDawson:
Hm, I don't think Jens is going to add freeglut template to C::B.
Why do you think he is going to do so?
I've re-read his post couple of times and there is nothing mentioned about that.

If you want us to add the template, you should provide a patch against HEAD of trunk!

p.s. Please don't quote the whole previous message, including the quote. The idea of quoting is to highlight a part of the message you're answering to.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline searcher

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: ld.exe cannot find -lfreeglut
« Reply #20 on: December 06, 2011, 02:06:19 am »
@JackDawson

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
    if (PLATFORM == PLATFORM_MSW)
    {
        project.AddLinkLib(_T("freeglut"));      
        project.AddLinkLib(_T("opengl32"));
        project.AddLinkLib(_T("glu32"));
        project.AddLinkLib(_T("winmm"));
        project.AddLinkLib(_T("gdi32"));
    }
    else if (PLATFORM == PLATFORM_MAC)
(2) The glut.cbp file:
   <Add directory="$(#glut.include)" />
      </Compiler>
      <Linker>
         <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)" />
      </Linker>
      <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.

Offline searcher

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: ld.exe cannot find -lfreeglut
« Reply #21 on: December 06, 2011, 10:35:35 pm »
@JackDawson.
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.

Offline Hesam

  • Single posting newcomer
  • *
  • Posts: 4
Re: ld.exe cannot find -lfreeglut
« Reply #22 on: July 22, 2012, 01:41:36 pm »
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

zoznam0

  • Guest
Re: ld.exe cannot find -lfreeglut
« Reply #23 on: May 30, 2021, 07:42:32 am »
https://sourceforge.net/projects/codeblocks/files/Binaries/20.03/Windows/codeblocks-20.03mingw-nosetup.exe
https://www.transmissionzero.co.uk/files/software/development/GLUT/freeglut-MinGW.zip
https://www.transmissionzero.co.uk/files/software/development/GLUT/freeglut-MSVC.zip

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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: ld.exe cannot find -lfreeglut
« Reply #24 on: May 30, 2021, 05:39:33 pm »
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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org