Thread: Problems with OpenGL(glut) in C++

  1. #16
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I'm only "guessing based on what I happened to find on the web", but perhaps you should use "-lglut32"?

    http://www.xmission.com/~nate/glut/README-win32.txt

    If that fails, open a command prompt window, and do "dir /s/b *glut*lib" on the disk where you expect to find your library files. If it's not obvious to you what's the right answer, post the output of this command here. [assuming of course it's not HUGE - it shouldn't be].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  2. #17
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    -lglut is the option (for gcc at least), [edit: see above] but not the library name. so what is the form name that you put -lglut into, libraries to be added, or linker settings/options?

    and what ide are you using?

  3. #18
    Registered User
    Join Date
    Nov 2007
    Posts
    17
    sorry ide? do you mean like Dev-C++... thats the compiler im using...when i searched lglut nothing was found even though i installed glut.lib in the library folder

  4. #19
    Registered User
    Join Date
    Nov 2007
    Posts
    17
    -lglut32 didnt work...in fact when i used it the glut linker reference errors went away but about 3 times as many other linker erros came up

  5. #20
    Registered User
    Join Date
    Nov 2007
    Posts
    17
    in the library folder there are both glut.lib and glut32.lib

  6. #21
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Abood View Post
    -lglut32 didnt work...in fact when i used it the glut linker reference errors went away but about 3 times as many other linker erros came up
    Really - are you sure that what happens isn't that you ALSO need some other library to support GLUT?


    Again, I may be horribly wrong here, but perhaps this link gives the right answer:
    http://www.cosc.brocku.ca/Offerings/...vcnetglut.html

    It links to:
    opengl32.lib, glu32.lib, glaux.lib glut32.lib
    In gcc that would be:
    -lopengl32 -lglu32 -lglaux -lglut32

    If you only have -lglut32 I would expect lots of linker errors because glut32 depends on other things.

    But again, I'm just guessing.

    However, if you are definitely sure that those glut... undefined symbols are gone (and not jjust hiding in a bigger pile of undefined symbols) then I would say that part of the problem is that you don't link in some other necessary libraries.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #22
    Registered User
    Join Date
    Nov 2007
    Posts
    17
    *sigh* no one here uses Dev-C++?

  8. #23
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Abood View Post
    *sigh* no one here uses Dev-C++?
    I don't think that's actually part of the problem. But perhaps you can make Dev-C++ generate a makefile and post that here?

    I know several regulars use Dev-C++ here - I don't, I use gcc sometimes, but in conjunction with Emacs as the "IDE" - only because I'm used to Emacs.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  9. #24
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    I agree with matsp. I'm almost certain that you need to link with those other libraries also.

  10. #25
    Registered User
    Join Date
    Nov 2007
    Posts
    17
    I think i'm going to give up and maybe wait until I buy visual studio because nothing works...

  11. #26
    Registered User
    Join Date
    Nov 2007
    Posts
    17
    I still really appreciate all your help...thx alot

  12. #27
    Registered User
    Join Date
    Nov 2007
    Posts
    17
    wait before i stop...can someone explain exactly how i link to the project, that could be the problem. Do i then make a new file IN the project? Do i need additional files i'm missing IN the project????

  13. #28
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    If you do it on the command line, you would do something like this:
    gcc -o myprog myprog.o myfuncs.o -lopengl32 -lglu32 -lglaux -lglut32

    You may need OTHER -lxxx too - perhaps -lm for example for math functions.

    And of course the "myprog" and "mufuncs" would be names of your files that have been previously compiled into object files.

    Also, you don't need to BUY Visual Studio. There is a free version, Visual Studio Express Edition, that is available from MS for no fee at all. Should be as good as any gcc-based produce when it comes to "what you can do", but slightly more "slick" in the integration of the tools into an IDE [my personal opinion].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. No clue how to make a code to solve problems!
    By ctnzn in forum C Programming
    Replies: 8
    Last Post: 10-16-2008, 02:59 AM
  2. C Pointers Problems
    By mhelal in forum C Programming
    Replies: 8
    Last Post: 01-10-2007, 06:35 AM
  3. String Manipulation problems -_-
    By Astra in forum C Programming
    Replies: 5
    Last Post: 12-13-2006, 05:48 PM
  4. contest problems on my site
    By DavidP in forum Contests Board
    Replies: 4
    Last Post: 01-10-2004, 09:19 PM
  5. DJGPP problems
    By stormswift in forum C Programming
    Replies: 2
    Last Post: 02-26-2002, 04:35 PM