Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-10-2012, 20:51   #1
Registered User

Join Date: Jul 2009
Location: Oriental, NC
Boat: Cal2/46
Posts: 14
Linux link error on master branch

For the past couple weeks I've been seeing a linker error on builds against github master:

Code:
Linking CXX executable opencpn
/usr/bin/ld: libNMEA0183.a(nmea.cpp.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5'
/usr/bin/ld: note: 'dlsym@@GLIBC_2.2.5' is defined in DSO /lib64/libdl.so.2 so try adding it to the linker command line
This is on Fedora 16, using cmake 2.8.8. The root of the problem seems to be a commit on 9/30, which was intended to "Correct CMake library linkage rules for some linux builds". Unfortunately, removing dl breaks the build on my particular linux

Code:
commit 428eb654f19f15eecef731bb04fb716684e0229d
Author: David Register <bdbcat@users.sourceforge.net>
Date:   Sun Sep 30 21:41:14 2012 -0400

    Correct CMake library linkage rules for some linux builds, esp. Debian

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 509bbdc..63293b0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -776,13 +776,9 @@ ENDIF(UNIX)
 
 #   Certain older Cmake FindGTK2 modules ( e.g. cmake-2.8.0-2) do not yield all
 #   So, add them manually.
-IF(UNIX AND NOT APPLE)
-TARGET_LINK_LIBRARIES(${PACKAGE_NAME}
-      dl
-      gobject-2.0
-)
-ENDIF(UNIX AND NOT APPLE)
+IF(GTK2_FOUND)
+TARGET_LINK_LIBRARIES( ${PACKAGE_NAME} gobject-2.0 )
+ENDIF(GTK2_FOUND)
__________________

__________________
teotwawki is offline   Reply With Quote
Old 12-10-2012, 02:34   #2
Registered User

Join Date: Mar 2010
Location: Normandy, France
Boat: Flush Poker, 8.25m (Point Barre)
Posts: 335
Re: Linux link error on master branch

Same here :-(
I put a comment on the commit https://github.com/OpenCPN/OpenCPN/c...fb716684e0229d.
Wayting for Dave answer...

For now, you can revert the commit:
$ git revert 428eb654f19f15eecef731bb04fb716684e0229d

Or execute
$ export LDFLAGS="$LDFLAGS -ldl"
before running cmake
__________________

__________________
SethDart is offline   Reply With Quote
Old 12-10-2012, 04:13   #3
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 303
Re: Linux link error on master branch

My gentoo / Sabayon machine does't have the errors.
__________________
rooiedirk is offline   Reply With Quote
Old 12-10-2012, 08:18   #4
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,884
Re: Linux link error on master branch

Good Morning....

OK, easy fix. I have been trying to simplify the CMake script, and remove platform dependencies wherever possible.

As Einstein is said to have said:
"Make things as simple as possible, and no simpler."

And that's why we do Beta testing....

Dave
__________________
bdbcat is offline   Reply With Quote
Old 19-10-2012, 07:13   #5
Registered User

Join Date: Jul 2009
Location: Oriental, NC
Boat: Cal2/46
Posts: 14
Re: Linux link error on master branch

Latest master takes care of the problem -- thanks Dave.
__________________
teotwawki is offline   Reply With Quote
Reply

Tags
linux

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 09:29.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.