trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: March 2012

Re: [trinity-devel] CMake - how to add library to build?

From: Darrell Anderson <humanreadable@...>
Date: Fri, 9 Mar 2012 11:04:50 -0800 (PST)
> It is a "gcc >=4.6.2" issue.  With the new mandates
> from gcc, any external
> library references are now required to be explicitly
> designated in the linker
> string. IIRC prior to 4.6.2, simply having the library on
> your system and the
> compiler being able to find it was enough. That's what the
> error is telling you:
> 
> /usr/bin/ld: CMakeFiles/ksnapshot.dir/windowgrabber.cpp.o:
> undefined reference
> to symbol 'XShapeQueryExtension'
> /usr/bin/ld: note: 'XShapeQueryExtension' is defined in DSO
> /usr/lib/libXext.so.6 so try adding it to the linker command
> line
> /usr/lib/libXext.so.6: could not read symbols: Invalid
> operation
> collect2: ld returned 1 exit status
> 
> THIS is the important part of the error:
> 
> /usr/bin/ld: note: 'XShapeQueryExtension' is defined in DSO
> /usr/lib/libXext.so.6 so try adding it to the linker command
> line
> 
> It's gcc telling you, "I know exactly where the darn symbol
> is located, but I'm
> not going to use the damn thing until you put it in your
> linker string..."

Yes, I understand that gcc is becoming more persnickety with each release. All I am questioning is why the failure with ksnapshot? No previous build used Xext to build ksnapshot. I see the "-lXext" reference in my build log for kuickshow but not with ksnapshot. Seems gcc is overextending itself and linking things that previously were not linked.

Darrell