Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 7 of 7

Thread: Cannot open file freeglut.lib

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    4

    Cannot open file freeglut.lib

    So I just got OpenGL super bible 5th edition and I cant get past chapter 1. Every time I compile it says "Cannot open file freeglut.lib"
    I have freeglut_static added and all my references to my libraries are right (hopefully?).
    Im using MSVS 2010 btw.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,726

    Re: Cannot open file freeglut.lib

    I'd guess that it's not looking for "freeglut_static.lib", because it says that it's looking for "freeglut.lib". See the difference?

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    4

    Re: Cannot open file freeglut.lib

    Well in the book it doesn't mention freeglut.lib anywhere, only the freeglut_static one.
    Also another error that is occuring is when I compile it "Unable to start the program .../project/triangle/debug/triangle.exe the system cannot find the file specified".

    I added freeglut.lib to check it out, but I got even more errors then before.

  4. #4
    Member Regular Contributor
    Join Date
    Apr 2010
    Posts
    493

    Re: Cannot open file freeglut.lib

    Well, since linking fails no executable is produced so it is no surprise that triangle.exe can not be found and started

    Unfortunately on windows there are two very different types of libraries that both use the .lib extension:
    1) static libraries (which is probably what you want)
    2) import libraries for DLLs.

    It's impossible to be sure, since you did not post the errors you are getting now (hint, hint ), but my guess is the file called freeglut.lib that you have is actually of kind 2) when you want kind 1).
    Try renaming your freeglut_static.lib to freeglut.lib and see if that makes a difference.

  5. #5
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    4

    Re: Cannot open file freeglut.lib

    Those are the errors that I am getting. After I compile I get a message box that says
    "Unable to start the program .../project/triangle/debug/triangle.exe the system cannot find the file specified".

    And at the bottom of my IDE, the error list, it says:
    error LNK1104 "cannot open file "freeglut.lib"

    I have tried renaming the freeglut_static.lib to freeglut.lib, but I still get errors (different ones though and more of them).

    No idea why this doesn't work correctly.

  6. #6
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,726

    Re: Cannot open file freeglut.lib

    In the instructions for setting up the build for these, did it tell you where to put these libraries? Did it tell you to provide special command line parameters and such?

  7. #7
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    4

    Re: Cannot open file freeglut.lib

    The instructions weren't so great. Its also aimed more for MSVS 2008.

    I just figured it out so ill post the solution.
    1) If your having troubles with this just download freeglut.lib (http://www.transmissionzero.co.uk/so...reeglut-devel/)
    2) Copy the freeglut.dll into your windows/system32 folder or windows/SysWOW64 for 64 bit users like me
    3) Add a reference to it in your program and ignore that freeglut_static.lib. I just removed it.

    This is what works for me.
    Thanks for help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •