LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-29-2006, 01:00 AM   #1
mcriddy
LQ Newbie
 
Registered: Jun 2006
Posts: 3

Rep: Reputation: 0
Unhappy weird ld error adding an extra -l


Has anyone ever seen this before? When I'm making this project, i get the error "can't find -l-lXext". When i try removing -lXext, just to see what happens, i get the extra -l attached to the next lib. Nowhere in my makefiles is there a lib linked to like "-l-l", plus i'm sure i have all of the libs it wants. Here is the compile command and the error. Any ideas?

Code:
ake[4]: Entering directory `/home/mcrider/vuVolume2/vuQT4Gui/vuParII'
/bin/sh ../../libtool --mode=link g++  -O2 -g    -o vuParII -I/usr/local/Trolltech/Qt-4.1.4/include  -I/usr/X11R6/include -pthread -I/usr/X11R6/include -pthread -pthread  main.o vuParII.o vuParameterSet.o vuQTHapticDevice.o vuParII_moc.o vuQTHapticDevice_moc.o ../../Renderers/libvuRenderers.la ../../PipeTools/libvuPipeTools.la ../../Volume/libvuVolume.la ../../General/libvuGeneral.la ../../vuQT4Gui/vuParallelCoord/libvuParallelCoord.la ../../vuQT4Gui/vuQTRenderWindow/libvuQTRenderWindow.la../../Extern/libvuExtern.la -L/usr/local/Trolltech/Qt-4.1.4/lib -l   -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi   -lGLU -lGL -L/usr/X11R6/lib -lX11  -lm -lglut -lGL -L/usr/X11R6/lib -lX11  -lm -lglut    parameter/libvuParII_parameter.la ../editors/libvuQTGui_editors.la ../../Renderers/libvuRenderers.la ../../PipeTools/libvuPipeTools.la ../../Volume/libvuVolume.la ../../General/libvuGeneral.la ../../vuQT4Gui/vuParallelCoord/libvuParallelCoord.la ../../vuQT4Gui/vuQTRenderWindow/libvuQTRenderWindow.la ../../Extern/libvuExtern.la -L/usr/local/Trolltech/Qt-4.1.4/lib -l   -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi   -lGLU -lGL -L/usr/X11R6/lib -lX11  -lm -lglut -lGL -L/usr/X11R6/lib -lX11  -lm -lglut
g++ -O2 -g -o .libs/vuParII -I/usr/local/Trolltech/Qt-4.1.4/include -I/usr/X11R6/include -I/usr/X11R6/include main.o vuParII.o vuParameterSet.o vuQTHapticDevice.o vuParII_moc.o vuQTHapticDevice_moc.o  -pthread -L/usr/local/Trolltech/Qt-4.1.4/lib -L/usr/X11R6/lib parameter/.libs/libvuParII_parameter.a /home/mcrider/vuVolume2/Renderers/.libs/libvuRenderers.so /home/mcrider/vuVolume2/PipeTools/.libs/libvuPipeTools.so /home/mcrider/vuVolume2/Volume/.libs/libvuVolume.so /home/mcrider/vuVolume2/General/.libs/libvuGeneral.so /home/mcrider/vuVolume2/Extern/.libs/libvuExtern.so ../editors/.libs/libvuQTGui_editors.a ../../Renderers/.libs/libvuRenderers.so ../../PipeTools/.libs/libvuPipeTools.so ../../Volume/.libs/libvuVolume.so ../../General/.libs/libvuGeneral.so ../../vuQT4Gui/vuParallelCoord/.libs/libvuParallelCoord.a ../../vuQT4Gui/vuQTRenderWindow/.libs/libvuQTRenderWindow.a ../../Extern/.libs/libvuExtern.so -l -lXext -lXmu -lXt -lXi -lGLU -lGL -lX11 -lm -lglut -Wl,--rpath -Wl,/usr/local/lib
/usr/bin/ld: cannot find -l-lXext
collect2: ld returned 1 exit status
make[4]: *** [vuParII] Error 1
make[4]: Leaving directory `/home/mcrider/vuVolume2/vuQT4Gui/vuParII'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/mcrider/vuVolume2/vuQT4Gui/vuParII'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/mcrider/vuVolume2/vuQT4Gui'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mcrider/vuVolume2'
make: *** [all] Error 2
 
Old 06-29-2006, 07:31 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Instead of removing '-lXext', I would just remove '-l'. Looks like you have somewhere an empty variable (so added to a '-l' still gives '-l')
If this comes from an IDE, maybe the first line in the list of libraries is empty (or the last one).
 
Old 07-02-2006, 06:46 PM   #3
mcriddy
LQ Newbie
 
Registered: Jun 2006
Posts: 3

Original Poster
Rep: Reputation: 0
tried two things

So i went into the Makefile (i know thats not the way to fix the problem, but thought it would just show that it is fixable) of this directory, and tried a) deleting the standalone -l that comes before it, which gives me an error about not finding one of my own libs (which does exist) and b) deleted the -l that is attached to Xext, and get an error that it can't find "Xext". So either i need to find the right file to edit or there is a bug in ld... btw, i've tried this on the mac (i'm porting this qt3 app to qt4 so it will be multiplatform), and get stuck on the same error. That makes it seem like it is a problem w/ my code.
 
Old 07-02-2006, 10:56 PM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
It will not be a problem in the C/C++ code. Can you post the makefile so we can have a look at it. I'm not a make specialist, but someone else might be.
 
Old 07-03-2006, 07:02 PM   #5
mcriddy
LQ Newbie
 
Registered: Jun 2006
Posts: 3

Original Poster
Rep: Reputation: 0
makefiles

o we don't have a 50kb forum post, i put the makefile for the root folder
of the project at:
sfu.ca/~mcrider/MakefileRoot.txt
and the makefile for the subdirectory that goes wonkers is:
sfu.ca/~mcrider/MakefileVuParII.txt

I'd appreciate if someone would take a look at it and see if there is any
weirdness.

BTW, i'm using Debian Sarge, with
GNU ld version 2.15
(GNU libtool) 1.5.6
g++ (GCC) 3.3.5

Cheers,
matt
 
Old 07-03-2006, 08:36 PM   #6
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
"-lXext", as you know, is fine.

"-l" with nothing after it is bad.

You've got a couple of instances of "-l " - in QT_LIBS and LIBS (in MakefileVuParII.txt), and again in QT_LIBS in MakefileRoot.txt.

Delete 'em and see what happens!

'Hope that helps .. PSM

PS:
It looks like something Qt probably auto-generated behind your back. I'm a GTK+ 2 fan, myself ;-)
 
  


Reply



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
adding an extra ip to your system configurations seraphangel Red Hat 1 03-21-2006 02:10 AM
adding a harddrive for extra space fakie_flip Linux - Hardware 5 10-02-2005 08:39 PM
dns adding extra webserver bristi Linux - Networking 0 09-08-2005 05:23 AM
adding extra repositories? KezzerDrix Mandriva 1 04-27-2005 09:55 AM
adding an extra pci slot diversitas Linux - Hardware 1 04-16-2005 02:00 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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