LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-16-2004, 05:30 AM   #1
atlep
LQ Newbie
 
Registered: Aug 2004
Posts: 14

Rep: Reputation: 0
Question 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 
 /usr/bin/ld: cannot find -lglut 
 collect2: ld returned 1 exit status 
 
 $ locate libglut 
 /usr/X11R6/lib/libglut.so.3 
 /usr/X11R6/lib/libglut.so.3.7.1 
 
 # ldconfig -p | grep glut 
libglut.so.3 (libc6) => /usr/X11R6/lib/libglut.so.3
As you can see, libglut exits, but the linker still claims it can't find it. Why might that be?

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.
 
Old 08-16-2004, 05:40 AM   #2
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
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
 
Old 08-16-2004, 05:48 AM   #3
atlep
LQ Newbie
 
Registered: Aug 2004
Posts: 14

Original Poster
Rep: Reputation: 0
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
 
Old 08-16-2004, 05:52 AM   #4
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
stupid un deletable posts damn you

Last edited by infamous41md; 08-16-2004 at 05:54 AM.
 
Old 08-16-2004, 05:53 AM   #5
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
http://www.linuxquestions.org/questi...hreadid=210728
 
Old 08-16-2004, 06:15 AM   #6
atlep
LQ Newbie
 
Registered: Aug 2004
Posts: 14

Original Poster
Rep: Reputation: 0
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.

Anyways, thanks for your help. A little reading around the problem helped kick-start the necessary brain cells.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
file not found by glob? - file exists? rgdatit Linux - Newbie 2 07-29-2005 02:16 AM
ksh check if file exists (using wildcard) problem r18044 Linux - Newbie 5 02-22-2005 07:52 AM
SIOCADDRT: File exists SIOCCADDRT: File Exists Failed to bring up eth0. opsraja Linux - Networking 0 01-10-2005 08:29 AM
Yum Update complains of missing file to do update, but file exists! davidas Linux - Newbie 0 03-28-2004 11:14 AM
file exists? raven Programming 7 10-26-2003 07:44 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration