Linking issues on OSX Mavericks

Jeremy Whiting jpwhiting at kde.org
Wed Dec 3 15:20:44 PST 2014


Hello list,

In discussion with Marko Käning I've been trying to get kde frameworks (aka
kf5) to build on mac osx mavericks by using kdesrc-build which is a perl
script that runs cmake, make and make install with some additional options
specified. With the help of macports for most dependencies I'm able to
build 13 of the frameworks, but the others fail. Many when building test
applications with errors as seen here:

https://paste.kde.org/psdzdpguq <-- error log from kcoreaddons.

If I try make VERBOSE=1 I see this:

[  3%] Built target KF5CoreAddons_automoc
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f
src/lib/CMakeFiles/KF5CoreAddons.dir/build.make
src/lib/CMakeFiles/KF5CoreAddons.dir/depend
cd /Users/jeremywhiting/devel/kde/build/frameworks/kcoreaddons &&
/opt/local/bin/cmake -E cmake_depends "Unix Makefiles"
/Users/jeremywhiting/devel/kde/src/frameworks/kcoreaddons
/Users/jeremywhiting/devel/kde/src/frameworks/kcoreaddons/src/lib
/Users/jeremywhiting/devel/kde/build/frameworks/kcoreaddons
/Users/jeremywhiting/devel/kde/build/frameworks/kcoreaddons/src/lib
/Users/jeremywhiting/devel/kde/build/frameworks/kcoreaddons/src/lib/CMakeFiles/KF5CoreAddons.dir/DependInfo.cmake
--color=
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f
src/lib/CMakeFiles/KF5CoreAddons.dir/build.make
src/lib/CMakeFiles/KF5CoreAddons.dir/build
make[2]: Nothing to be done for `src/lib/CMakeFiles/KF5CoreAddons.dir/build'.
/opt/local/bin/cmake -E cmake_progress_report
/Users/jeremywhiting/devel/kde/build/frameworks/kcoreaddons/CMakeFiles
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
[ 87%] Built target KF5CoreAddons
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f
tests/CMakeFiles/faceicontest.dir/build.make
tests/CMakeFiles/faceicontest.dir/depend
cd /Users/jeremywhiting/devel/kde/build/frameworks/kcoreaddons &&
/opt/local/bin/cmake -E cmake_depends "Unix Makefiles"
/Users/jeremywhiting/devel/kde/src/frameworks/kcoreaddons
/Users/jeremywhiting/devel/kde/src/frameworks/kcoreaddons/tests
/Users/jeremywhiting/devel/kde/build/frameworks/kcoreaddons
/Users/jeremywhiting/devel/kde/build/frameworks/kcoreaddons/tests
/Users/jeremywhiting/devel/kde/build/frameworks/kcoreaddons/tests/CMakeFiles/faceicontest.dir/DependInfo.cmake
--color=
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f
tests/CMakeFiles/faceicontest.dir/build.make
tests/CMakeFiles/faceicontest.dir/build
Linking CXX executable faceicontest.app/Contents/MacOS/faceicontest
cd /Users/jeremywhiting/devel/kde/build/frameworks/kcoreaddons/tests
&& /opt/local/bin/cmake -E cmake_link_script
CMakeFiles/faceicontest.dir/link.txt --verbose=1
/usr/bin/c++   -pipe -DQT_STRICT_ITERATORS -DQURL_NO_CAST_FROM_STRING
-DQT_NO_HTTP -DQT_NO_FTP -Wformat -Werror=format-security
-Werror=return-type -Wno-variadic-macros -Wlogical-op -std=c++0x -Wall
-Wextra -Wcast-align -Wchar-subscripts -Wformat-security
-Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor
-Woverloaded-virtual -Werror=return-type -fexceptions -g
-Wl,-search_paths_first -Wl,-headerpad_max_install_names
CMakeFiles/faceicontest.dir/faceicontest.cpp.o
CMakeFiles/faceicontest.dir/faceicontest_automoc.cpp.o  -o
faceicontest.app/Contents/MacOS/faceicontest
/opt/local/Library/Frameworks/QtWidgets.framework/QtWidgets
../src/lib/libKF5CoreAddons.5.5.0.dylib
/opt/local/Library/Frameworks/QtGui.framework/QtGui
/opt/local/Library/Frameworks/QtCore.framework/QtCore
Undefined symbols for architecture x86_64:
  "KUser::allUsers(unsigned int)", referenced from:
      FaceIconTest::FaceIconTest() in faceicontest.cpp.o
  "KUser::KUser(KUser const&)", referenced from:
      QList<KUser>::node_copy(QList<KUser>::Node*,
QList<KUser>::Node*, QList<KUser>::Node*) in faceicontest.cpp.o
  "KUser::~KUser()", referenced from:
      QList<KUser>::node_copy(QList<KUser>::Node*,
QList<KUser>::Node*, QList<KUser>::Node*) in faceicontest.cpp.o
      QList<KUser>::node_destruct(QList<KUser>::Node*,
QList<KUser>::Node*) in faceicontest.cpp.o
  "KUser::faceIconPath() const", referenced from:
      FaceIconTest::FaceIconTest() in faceicontest.cpp.o
  "KUser::loginName() const", referenced from:
      FaceIconTest::FaceIconTest() in faceicontest.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

So it seems it's specifying the right paths to find the library to link against.

nm on the .dylib shows the symbols that the linker says are missing.
file on the dylib says it's x86_64 format. otool -L shows it is
linking against libc++ so I'm not sure what else would cause this.


Note I'm a bit new to development on Mac though I've dabbled in it
before. I build software on linux quite a lot and a bit on windows
also so am used to compiler differences, but I'm a bit stumped here so
I thought I'd ask for ideas.


thanks,

Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-dev/attachments/20141203/2a08a72c/attachment.html>


More information about the macports-dev mailing list