LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-30-2008, 01:02 PM   #1
kuloch
LQ Newbie
 
Registered: Aug 2008
Posts: 1

Rep: Reputation: 0
Question gcc not seeing libraries


I'm trying to compile an example program that uses GLUT (already have tested GLUT as working), but it doesn't seem to see other required libraries that are present, even when I specify the library path with -L.

Here's the command that Makefile is calling - after I edited it to use the correct paths - and the immediate error:
Code:
gcc -o example1 -L/usr/lib example1.o -lglut -lXmu -lXext -lXi -lX11 -lm  
/usr/bin/ld: cannot find -lXmu
/usr/lib/libXmu.so.6 exists (as a symlink to /usr/lib/libXmu.so.6.2.0), so I don't understand the problem. And it shouldn't even be necessary to specify -L/usr/lib, as it finds /usr/lib/libglut.so just fine without any -L flag.

***EDIT***

Bah, I'm sorry. Only after posting did I notice that it looked funny to have 'libglut.so' but no 'libXmu.so', so I tried making a symlink. Bam, it suddenly works.

Last edited by kuloch; 08-30-2008 at 01:11 PM. Reason: fixed
 
Old 08-30-2008, 09:30 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,917

Rep: Reputation: 2586Reputation: 2586Reputation: 2586Reputation: 2586Reputation: 2586Reputation: 2586Reputation: 2586Reputation: 2586Reputation: 2586Reputation: 2586Reputation: 2586
Welcome to Linux Questions.

When you are compiling, it is "always" the
'libsomething.so' that is used.

And the correct way to handle it is to install
that library -devel version.
( e.g. 'libXmu-devel' or 'libxmu-dev' , same lib,
different names in different Linux's )

These packages -devel contains some headers
too ( file.h ) which you might be missing too,
so it's a good idea installing the packages.

Regards

Last edited by knudfl; 09-01-2008 at 05:39 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
gcc-libraries yashwantpinge Programming 3 11-22-2005 12:17 AM
GCC-3.3.4 C++ & Depreciated libraries aes canis Programming 3 05-12-2005 06:12 AM
SUSE 9.1 and gcc, cc, c, c++, mpich libraries Hypermood Linux - Newbie 7 12-08-2004 10:25 AM
Problem with linking libraries using gcc shortyzms Linux - Software 1 03-29-2004 08:13 PM
C libraries with GCC compiler Ciccio Programming 2 12-02-2002 11:20 AM


All times are GMT -5. The time now is 03:41 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration