LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problem on linking Xm Xt X11 libraries (https://www.linuxquestions.org/questions/linux-newbie-8/problem-on-linking-xm-xt-x11-libraries-167062/)

yaotz 04-06-2004 07:13 PM

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

Tinkster 04-06-2004 08:15 PM

Sure can install them - RH comes with all
the XFree stuff you'll ever need... :}


Cheers,
Tink

yaotz 04-07-2004 01:24 AM

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

Tinkster 04-07-2004 04:24 AM

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

johnhardey 02-16-2005 01:21 AM

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

yaotz 02-17-2005 05:42 AM

My problem was solved by the exact following statement, "-L/usr/X11R6/lib -lXm -lXt -lX11 -lm"

Good luck!

kevin_hill54 02-17-2005 05:46 AM

What is a compiler call and how do you create / do one??

__J 02-17-2005 05:52 AM

be more specific on "compiler call"

yaotz 03-07-2005 09:46 AM

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.

__J 03-07-2005 11:03 AM

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.