By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.
Bug 902 - Build issue: tdegraphics/ksnapshot/CMakeLists.txt -> libXext must be explicity linked (gcc >= 4.6.2)
Summary: Build issue: tdegraphics/ksnapshot/CMakeLists.txt -> libXext must be explicit...
Status: RESOLVED FIXED
Alias: None
Product: TDE
Classification: Unclassified
Component: tdegraphics (show other bugs)
Version: R14.0.0 [Trinity]
Hardware: All Linux
: P5 major
Assignee: Timothy Pearson
URL:
Depends on:
Blocks:
 
Reported: 2012-03-08 21:06 CST by David C. Rankin
Modified: 2012-05-13 17:28 CDT (History)
2 users (show)

See Also:
Compiler Version:
TDE Version String:
Application Version:
Application Name:


Attachments
patch for ksnapshot/CMakeLists.txt (345 bytes, patch)
2012-03-08 21:06 CST, David C. Rankin
Details | Diff
ksnapshot CMakeLists patch proposed by Serghei (804 bytes, patch)
2012-03-09 09:24 CST, David C. Rankin
Details | Diff
Updated patch (1.22 KB, patch)
2012-04-27 17:42 CDT, Darrell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David C. Rankin 2012-03-08 21:06:03 CST
Created attachment 472 [details]
patch for ksnapshot/CMakeLists.txt

Tim, Serghei,

  With gcc >=4.6.2 external library reference must be explicitly part of the linker command or the build with fail when external objects are referenced. With ksnapshot, the build fails with:

/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

  I have incorporated the rough hack suggested by Serghei and the build completes without issue. I presume the configurechecks will need to be updated to take this 'rough' hack to a proper patch, but I don't know how to implement the checks at this time. I have provided a patch that will allow tdegraphics to build with gcc>=4.6.2 and will leave the cleanup to the cmake master.
Comment 1 David C. Rankin 2012-03-08 21:06:53 CST
The patch itself is:

--- tdegraphics/ksnapshot/CMakeLists.txt
+++ tdegraphics/ksnapshot/CMakeLists.txt        2012-03-08 19:10:16.942936109 -0600
@@ -40,6 +40,6 @@
   SOURCES
     ksnapshotiface.skel main.cpp ksnapshot.cpp regiongrabber.cpp
     windowgrabber.cpp ksnapshotwidget.ui
-  LINK tdeprint-shared
+  LINK tdeprint-shared Xext
   DESTINATION ${BIN_INSTALL_DIR}
 )
Comment 2 Darrell 2012-03-09 02:05:32 CST
Would a more proper solution be to test the value of the internal cmake variable HAVE_X11_EXTENSIONS_SHAPE_H and when true add the link? Something like this:

tde_add_executable( ksnapshot AUTOMOC
  SOURCES
    ksnapshotiface.skel main.cpp ksnapshot.cpp regiongrabber.cpp
    windowgrabber.cpp ksnapshotwidget.ui
    if( HAVE_X11_EXTENSIONS_SHAPE_H )
      LINK tdeprint-shared Xext
    else
      LINK tdeprint-shared
    endif( )
  DESTINATION ${BIN_INSTALL_DIR}
)

Second:

Is ksnapshot supposed to link against Xext? When I look at my tdegraphics build log, I see "-lXext" for kuickshow but no other tdegraphics components. The kuickshow CMakeLists.txt does not have a LINK directive for Xext but does have a LINK directive for IMLIB_LIBRARIES, through which kuickshow links to Xext. Looking at the older automake files does not show any ksnapshot linking to Xext or IMLIB_LIBRARIES.
Comment 3 David C. Rankin 2012-03-09 09:24:46 CST
Created attachment 473 [details]
ksnapshot CMakeLists patch proposed by Serghei

Here is the patch proposed by Serghei this morning on the list. (with consistend quotes :)
Comment 4 Calvin Morrison 2012-03-11 15:57:15 CDT
whoops automatically reassigned it to me, I'm reverting it! sorryg
Comment 5 Darrell 2012-04-27 13:11:22 CDT
What is the status of this patch? I just tried this patch with the latest GIT and gcc 4.7 and the build still fails with the same error.
Comment 6 Darrell 2012-04-27 17:42:37 CDT
Created attachment 566 [details]
Updated patch

On a wild hunch that perhaps the patch was correct (coming from Serghei), but merely not being loaded/executed at the correct time, I moved the patch to ConfigureChecks.cmake.

tdegraphics now builds without incident with gcc 4.7.

I don't know how to test that ksnapshot built correctly with libXext support because I don't know what the support includes (other than using ksnapshot).

David, would you please test the new patch?

I'll push to GIT upon a successful report. :-)
Comment 7 Darrell 2012-04-27 23:39:53 CDT
Updated patch pushed in GIT hash 0efb8a18.
Comment 8 Timothy Pearson 2012-05-13 17:28:04 CDT
Patch looks sane and no Debian/Ubuntu build failures have been noted.

Closing RESOLVED FIXED