Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I install almost all the packages, but it still does not work. The error message is exact like "/usr/bin/ld: cannot find -lXm". Is there any suggestion on which package I should install or I could download it somewhere?
Fist try to locate them, see whether they're there
at all, and just in a non-standard place (or you
just didn't give the compiler a pointer as for
where to find them ... ).
Try
locate libXdm
If it finds some files add
-L <their/path> to your compiler call
I know this post is very very old but I'm having the same problem as the original poster, so instead of starting a new thread, I'll revive this one.
As I said before, I got the same problem. 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
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.
The following one is the problem one,
gcc filename.o -lXm -lXt -lX11 -lm
Then change it to,
gcc filename.o -L/usr/X11R6/lib -lXm -lXt -lX11 -lm
Everything works!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.