problem on linking Xm Xt X11 libraries
Hi all,
I've got a problem when I tried to compile (or link) some files with Xm, Xt and X11 libraries under Redhat9.0. The command I use is: gcc filename.o -lXm -lXt -lX11 -lm The error message is "Can't find Xm". Is it due to absence of these library files in my linux system? Can I install it? Thanks |
Sure can install them - RH comes with all
the XFree stuff you'll ever need... :} Cheers, Tink |
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?
Thanks |
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 Cheers, Tink |
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. Please help. *Cheers |
My problem was solved by the exact following statement, "-L/usr/X11R6/lib -lXm -lXt -lX11 -lm"
Good luck! |
What is a compiler call and how do you create / do one??
|
be more specific on "compiler call"
|
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! I compile it under RedHat7.0. |
is /usr/X11R6/lib in /etc/ld.so.conf and have you run ldconfig?
|
All times are GMT -5. The time now is 07:26 AM. |