Using kdesrc-build on Mac OS X I got the following errors when building kde-runtime. Linking CXX executable kglobalaccel Undefined symbols for architecture x86_64: "GlobalShortcutsRegistry::keyPressed(int)", referenced from: hotKeyEventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) in kglobalaccel_mac.o KGlobalAccelImpl::keyPressed(int) in kglobalaccel_mac.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) There seems to be a problem in the CMakeLists.txt for kde-runtime/kglobalaccel or perhaps in the kde4_add_kdeinit_executable() macro as it functions on Mac OS X. MacPorts has a workaround for this problem, but it consists in editing a list of *.o files from the CMakeFiles/kdeinit_kglobalaccel.dir into the link.txt file in CMakeFiles/kglobalaccel.dir, sometime during the build. After my kdesrc-build run crashed the two directories contained different lists of *.o files. CMakeFiles/kdeinit_kglobalaccel.dir contained [globalshortcutcontext.o globalshortcutsregistry.o kdeinit_kglobalaccel_automoc.o kglobalaccel_mac.o component.o kglobalacceld.o globalshortcut.o main.o], but CMakeFiles/kglobalaccel.dir contained only [kglobalaccel_automoc.o kglobalaccel_dummy.o kglobalaccel_mac.o] and the last of these failed to link. Can you give me a patch or a workaround at the CMakeLists.txt level or macro level so that I can continue to build KDE software from source, using kdesrc-build? This is part of a project to investigate, fix, test code for a much wider range of bugs in KDE software that occur on OS X. Reproducible: Always Steps to Reproduce: Attempt to build kde-runtime from source on Mac OS X. Actual Results: Build failed with linker errors in target kglobalaccel, object file kglobalaccel_mac.o. Expected Results: Build without errors. I am a KDE developer working on Mac OS X. I wish to build development versions of KDE libraries, utilities and apps, with full debug information, and the option to patch and test source code. MacPorts is more oriented towards building release-type object-code for end-users.
The following problem occurs when using kdesrc-build on Mac OSX to build kde4-baseapps and is perhaps related to the above: Linking CXX executable konqueror.app/Contents/MacOS/konqueror Undefined symbols for architecture x86_64: "KonqMisc::konqFilteredURL(KonqMainWindow*, QString const&, QString const&)", referenced from: _kdemain in konqmain.o "KonqMisc::createBrowserWindowFromProfile(QString const&, QString const&, KUrl const&, KonqOpenURLRequest const&, bool)", referenced from: _kdemain in konqmain.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [konqueror/src/konqueror.app/Contents/MacOS/konqueror] Error 1 make[1]: *** [konqueror/src/CMakeFiles/konqueror.dir/all] Error 2
Created attachment 86646 [details] Proposed patch Ian, can you apply this patch to kdelibs, rebuild/reinstall it and then try building kde-runtime and kde-baseapps again?
You are a genius, Raphael! That patch went in without a hitch and I have now successfully re-built kdelibs, kde-runtime and kde-baseapps. The MacPorts guys will be pleased too. Thank you very much. Will you be putting it in master and KDE/4.13?
Yes. Thanks for testing!
Git commit bdb672c5af44f5715a5bdf81193b9021ecd9f07a by Raphael Kubo da Costa. Committed on 15/05/2014 at 13:30. Pushed by rkcosta into branch 'KDE/4.13'. KDE4_ADD_KDEINIT_EXECUTABLE: Check the right variable for Mac. Fix a regression introduced by 52ee7642, which copy-pasted some code from the Windows block. It caused the executable created with this macro to unconditionally build and depend on the last source file passed to it, even though it's only supposed to be part of the kdeinit_$TARGET target. FIXED-IN: 4.13.2 M +2 -2 cmake/modules/KDE4Macros.cmake http://commits.kde.org/kdelibs/bdb672c5af44f5715a5bdf81193b9021ecd9f07a
Backported to KDE libraries version 4.12.4 for current MacPorts tree in http://quickgit.kde.org/?p=macports-kde.git&a=commitdiff&h=49a61a2fd7399d2a49927e328b55709cfca5b49c