LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-16-2005, 07:59 PM   #1
johnhardey
LQ Newbie
 
Registered: Feb 2005
Posts: 4

Rep: Reputation: 0
"cannot find -lXm" why?


It's my first program in GCC with X Windows.

I compiled my code with this:
gcc HelloWorld.c -o HelloWorld -lXm -lXt -lX11

same as the original poster used.

I got the same error.
/usr/bin/ld: cannot find -lXm
collect2: ld returned 1 exit status

So I compiled it with the path from:
locate libXdm
which is:
/usr/X11R6/lib/libXdmcp.a

So I compiled the code with:
gcc HelloWorld.c -o HelloWorld -l/usr/X11R6/lib/libXdmcp.a -lXm -lXt -lX11

but the same error occured:
/usr/bin/ld: cannot find -l/usr/X11R6/lib/libXdmcp.a
collect2: ld returned 1 exit status

Then I saw some codes in the net and how to compile them so:
gcc HelloWorld.c -o HelloWorld -L/usr/X11R6/lib/libXdmcp.a -lXm -lXt -lX11

But then it goes back to:
/usr/bin/ld: cannot find -lXm
collect2: ld returned 1 exit status

What am I doing wrong? I'm using Fedora Core 3. I searched for the Xm, Xt and X11 folder in my computer using whereis. I did get the paths except for Xt but when I compile the problem started with Xm not Xt. The Xm and X11 folders do contain some files.

Please help.

*Cheers

Last edited by johnhardey; 02-16-2005 at 08:01 PM.
 
Old 02-16-2005, 08:51 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927
Did you actually try the hints I gave the other guy ?

I can't seen any -L/usr/X11R6/lib in your modified command...
Only an (doomed) attempt with a file where a path is required.

Cheers,
Tink

Last edited by Tinkster; 02-16-2005 at 08:52 PM.
 
Old 02-17-2005, 04:47 AM   #3
johnhardey
LQ Newbie
 
Registered: Feb 2005
Posts: 4

Original Poster
Rep: Reputation: 0
ah... the PATH... okies... thx...
 
  


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
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 07:42 AM
Several "find -exec" and "find | xargs" questions thanhvn Programming 4 12-02-2005 01:04 PM
Can't install "glibmm" library. "configure" script can't find "sigc++-2.0&q kornerr Linux - General 4 05-10-2005 02:32 PM
Where can I find the "make" & "cc" packages?? sayeed_ather Mandriva 2 04-28-2004 02:02 AM
"host" ok, but "ping" can't find ip address hardigunawan Linux - Networking 2 05-16-2002 05:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:46 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