Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 06-15-2003, 01:03 PM   #1
Registered: Mar 2002
Distribution: Redhat 9.0, Debian, Knoppix, YellowDog
Posts: 142

Rep: Reputation: 15
Linker problem -lX11

I'm trying to compile a program with the following extremely simple makefile:

gcc <prog1>.c <prog2>.c -o <program> -lX11

but it's failing to link in the X11 libraries. I'm not too sure how to resolve this my /etc/ has the line /usr/lib/X11 and I have re-run ldconfig but nothing seems to work.

Any help appreciated

Old 06-16-2003, 01:39 AM   #2
Registered: Mar 2002
Distribution: Redhat 9.0, Debian, Knoppix, YellowDog
Posts: 142

Original Poster
Rep: Reputation: 15
Sorted it out myself.

Still don't know why this failed with the default though.

Makefile is:

gcc xscan.c snoop.c -o xscan -lX11

which means its trying to link in with libX11.a

So I locate the file:

locate libX11.a

Then I check /etc/

cat /etc/

OK so the directory is there (2nd line), so why isn't ld finding it?

As stated in my previous post I had already run ldconfig but it had no effect.

Changing the Makefile to:

gcc xscan.c snoop.c -o xscan -L /usr/X11R6/lib/ -lX11

worked fine.

Incidentally this is OK as I work in my companies security team and we are authorised to go poking around our own servers for vulnerabilities. ;>



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
linker problem bahadur Programming 4 11-26-2005 06:43 AM
QT Hello world linker problem digitized_funk Programming 0 10-19-2003 01:30 AM
can not find lX11 problem lljxh Linux - Software 4 08-27-2003 12:58 AM
ld -lX11 can not find -lX11 Alexop Linux - Newbie 1 08-18-2002 07:01 PM
ld -lX11 can not find -lX11 Alexop Linux - General 1 08-18-2002 06:24 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:37 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration