Emulator Issues #3596
closedCmake compiling error in Debian sid (patch included)
0%
Description
What's the problem?
Seems like the new change to DSO linking (http://fedoraproject.org/wiki/UnderstandingDSOLinkChange) was commited upstream or something and already reached Debian sid therefore all other debian-based distro may be affected soon.
When compiling with cmake I get:
[100%] Building CXX object Source/Core/DolphinWX/CMakeFiles/dolphin-emu.dir/Src/X11Utils.cpp.o
Linking CXX executable ../../../Binaries/dolphin-emu
/usr/bin/ld: ../Common/libcommon.a(DynamicLibrary.cpp.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/bin/ld: note: 'dlclose@@GLIBC_2.2.5' is defined in DSO /lib64/libdl.so.2 so try adding it to the linker command line
/lib64/libdl.so.2: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[3]: *** [Binaries/dolphin-emu] Error 1
After adding -ldl to a CMakeList.txt file a different library is then asked. To fix this I used this quilt patch:
--- dolphin-emu-2.0+svn6495.orig/Source/Core/Core/CMakeLists.txt
+++ dolphin-emu-2.0+svn6495/Source/Core/Core/CMakeLists.txt
@@ -145,6 +145,10 @@ if(PORTAUDIO_FOUND)
set(LIBS ${LIBS} portaudio)
endif(PORTAUDIO_FOUND)
+if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
- set(LIBS ${LIBS} -ldl -lX11 -lgtk-x11-2.0 -lgdk-x11-2.0 -lgobject-2.0)
+endif()
add_library(core STATIC ${SRCS})
target_link_libraries(core ${LIBS})
With this the error is fixed in Debian sid 64bit and it is backwards compatible with Ubuntu Lucid/Maverick 32/64bit where this problem is still not present.
Dolphin version with the problem (as it appears in the title bar, Ex.: "R
4779" or "R 6403M"):
Latest svn.
I first noticed when I tried to use cmake for the 1st time (r6403).
Operating system and version:
Debian Sid 64-bit
Build command-line (not on Windows):
(cd Build && cmake -DCMAKE_INSTALL_PREFIX=/usr -DDOLPHIN_WC_REVISION=6495 ..)
...
(cd Build && /usr/bin/make -j2)
Please provide any additional information below.
This is similar to Issue 2820. I used scons to avoid this problem but after Issue 3595, I decided to just create a small patch for cmake and report it.
Updated by glennricster about 14 years ago
Thanks for reporting this. Your patch isn't quite the correct way to do it, but I will find a better way to fix it.
Updated by glennricster about 14 years ago
Test revision 6497 and see if this is fixed with that revision.
Updated by debian.micove about 14 years ago
Well it fixed the -ldl one but
Linking CXX executable ../../../Binaries/dolphin-emu
/usr/bin/ld: ../InputCommon/libinputcommon.a(Xlib.cpp.o): undefined reference to symbol 'XGetWindowAttributes'
/usr/bin/ld: note: 'XGetWindowAttributes' is defined in DSO /usr/lib64/libX11.so.6 so try adding it to the linker command line
/usr/lib64/libX11.so.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[3]: *** [Binaries/dolphin-emu] Error 1
Seems that -lX11 error still there . I listed them in order of appearance so not sure if -lgtk-x11-2.0 -lgdk-x11-2.0 -lgobject-2.0 error are also still there.
Updated by debian.micove about 14 years ago
Well here are the rest of them after I "fix" them using the quick hack from the 1st post. Hope this info helps for the other ones.
After "fixing" -lX11:
Linking CXX executable ../../../Binaries/dolphin-emu
/usr/bin/ld: CMakeFiles/dolphin-emu.dir/Src/X11Utils.cpp.o: undefined reference to symbol 'gtk_widget_get_type'
/usr/bin/ld: note: 'gtk_widget_get_type' is defined in DSO /usr/lib64/libgtk-x11-2.0.so.0 so try adding it to the linker command line
/usr/lib64/libgtk-x11-2.0.so.0: could not read symbols: Invalid operation
After "fixing" -lgtk-x11-2.0
Linking CXX executable ../../../Binaries/dolphin-emu
/usr/bin/ld: CMakeFiles/dolphin-emu.dir/Src/X11Utils.cpp.o: undefined reference to symbol 'gdk_x11_drawable_get_xdisplay'
/usr/bin/ld: note: 'gdk_x11_drawable_get_xdisplay' is defined in DSO /usr/lib64/libgdk-x11-2.0.so.0 so try adding it to the linker command line
/usr/lib64/libgdk-x11-2.0.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
After "fixing" -lgdk-x11-2.0
Linking CXX executable ../../../Binaries/dolphin-emu
/usr/bin/ld: CMakeFiles/dolphin-emu.dir/Src/X11Utils.cpp.o: undefined reference to symbol 'g_type_check_instance_cast'
/usr/bin/ld: note: 'g_type_check_instance_cast' is defined in DSO /usr/lib64/libgobject-2.0.so.0 so try adding it to the linker command line
/usr/lib64/libgobject-2.0.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
After "fixing" -lgobject-2.0
It works.
Updated by glennricster about 14 years ago
- Status changed from New to Fixed
This issue was closed by revision r6499.
Updated by debian.micove about 14 years ago
After compiling r6499 I got a new one :(
[100%] Building CXX object Source/Core/DolphinWX/CMakeFiles/dolphin-emu.dir/Src/X11Utils.cpp.o
Linking CXX executable ../../../Binaries/dolphin-emu
/usr/bin/ld: CMakeFiles/dolphin-emu.dir/Src/X11Utils.cpp.o: undefined reference to symbol 'XRRQueryVersion'
/usr/bin/ld: note: 'XRRQueryVersion' is defined in DSO /usr/lib/libXrandr.so.2 so try adding it to the linker command line
/usr/lib/libXrandr.so.2: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
Updated by debian.micove about 14 years ago
I looked at the diff and it seems you made a typo. This change make it work for me at last:
--- dolphin-emu-2.0+svn6499.orig/Source/Core/DolphinWX/CMakeLists.txt
+++ dolphin-emu-2.0+svn6499/Source/Core/DolphinWX/CMakeLists.txt
@@ -12,7 +12,7 @@ set(LIBS core
wiiuse
SDL
GL
-
${XRANDR_LIBS})
-
${XRANDR_LIBRARIES})
if(wxWidgets_FOUND)
set(MEMCARDSRCS Src/MemcardManager.cpp
Thanks for the hard work! :D