Linker problem: can't find a file, but the file exists
Hello everybody. I'm new here, searching for knowledgable forum to post my linux problems. This is the third forum I try to get help for the following problem.
I try to compile a simple GL-program using glut. But even though the libraries should be installed, the linker cannot find them. Here's an illustration: Code:
$ gcc simplegl.o -L /usr/X11R6/lib/ -lGL -lGLU -lglut -o simplegl Some extra, possibly relevant, information: Dist: Mandrake 10.0 The glut libs were installed from the distribution. However, the header files were not. So these are copied from: [cannot post url before five posts] www_ibiblio_org/pub/packages/development/graphics/glut/glut-3.5.tar.gz I hope someone can help me, since all simple 'getting started' openGL examples seem to be using glut. |
i'm not sure what's going on there, but if you want to workaround w/e is going on, just pass the shared lib on command line, ie:
gcc simplegl.o -L /usr/X11R6/lib/ -lGL -lGLU -o simplegl /usr/X11R6/lib/libglut.so.3 |
Thank you, that worked liked a charm. The program even executed perfectly! :)
I would still like to know if someone has any ideas about the problem posted, though. As I am sure an answer to this would provide me with some more understanding about how the compiler and linker works. I will be happy to follow this thread and try most suggestions, in order to work out the problem. Yeah, and it looks like I found my forum :) |
stupid un deletable posts damn you
|
|
I looked through the page, but couldn't find anything directly related to my problem. Since your above suggestion worked, it does not appear that I need to link any other libraries. And it also proves that the library is where it should be.
The only thing I can think of is some ....... (where's a light-bulb smilie when you need one) Yep, and problem is solved :) It seems the linker needs to find libglut.so and that libglut.so.3 was not enough. Would've thought the Mandrake distribution should've created that symlink when installing the libraries. :confused: Anyways, thanks for your help. A little reading around the problem helped kick-start the necessary brain cells. |
All times are GMT -5. The time now is 02:35 AM. |