Bug 405803 - Linking fails on macOS
Summary: Linking fails on macOS
Status: RESOLVED NOT A BUG
Alias: None
Product: cantor
Classification: Applications
Component: general (show other bugs)
Version: 18.12
Platform: Compiled Sources macOS
: NOR normal
Target Milestone: ---
Assignee: Filipe Saraiva
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-24 09:42 UTC by Stefan Gerlach
Modified: 2019-05-25 10:11 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gerlach 2019-03-24 09:42:37 UTC
Compiling 18.12 and master from source on macOS fails when linking.


STEPS TO REPRODUCE
1. cd build
2. cmake ..
3. make

OBSERVED RESULT

[ 23%] Linking CXX shared module libcantorpart.so
Undefined symbols for architecture x86_64:
  "Cantor::Expression::setCommand(QString const&)", referenced from:
      LoadedExpression::loadFromXml(QDomElement const&, KZip const&) in loadedexpression.cpp.o
  "Cantor::Expression::qt_metacall(QMetaObject::Call, int, void**)", referenced from:
      vtable for LoadedExpression in loadedexpression.cpp.o
  "Cantor::Expression::qt_metacast(char const*)", referenced from:
      vtable for LoadedExpression in loadedexpression.cpp.o
  "Cantor::Expression::clearResults()", referenced from:
      CommandEntry::evaluate(WorksheetEntry::EvaluationOption) in commandentry.cpp.o
      CommandEntry::removeResults() in commandentry.cpp.o
  "Cantor::Expression::errorMessage()", referenced from:
      CommandEntry::expressionChangedStatus(Cantor::Expression::Status) in commandentry.cpp.o
  "Cantor::Expression::removeResult(Cantor::Result*)", referenced from:
      CommandEntry::removeResult(Cantor::Result*) in commandentry.cpp.o
  "Cantor::Expression::addInformation(QString const&)", referenced from:
      vtable for LoadedExpression in loadedexpression.cpp.o
  "Cantor::Expression::internalCommand()", referenced from:
      vtable for LoadedExpression in loadedexpression.cpp.o
  "Cantor::Expression::staticMetaObject", referenced from:
      Worksheet::gotResult(Cantor::Expression*) in worksheet.cpp.o
  "Cantor::Expression::additionalLatexHeaders()", referenced from:
      vtable for LoadedExpression in loadedexpression.cpp.o


EXPECTED RESULT


SOFTWARE/OS VERSIONS
macOS: 10.12.6
KDE Frameworks Version: 5.55
Qt Version: 5.12.2

ADDITIONAL INFORMATION

Using craft the errors reduce to
[98/306] Linking CXX executable src/cantor.app/Contents/MacOS/cantor
FAILED: src/cantor.app/Contents/MacOS/cantor
: && /usr/bin/clang++  -std=c++0x -fno-operator-names -Wno-gnu-zero-variadic-macro-arguments -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Wvla -Wdate-time -fdiagnostics-color=always -std=c++0x -fno-operator-names -Wno-gnu-zero-variadic-macro-arguments -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Wvla -Wdate-time -fdiagnostics-color=always -pedantic -Wzero-as-null-pointer-constant -fexceptions -O3 -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names  src/CMakeFiles/cantor.dir/main.cpp.o src/CMakeFiles/cantor.dir/cantor.cpp.o src/CMakeFiles/cantor.dir/backendchoosedialog.cpp.o src/CMakeFiles/cantor.dir/cantor_autogen/mocs_compilation.cpp.o  -o src/cantor.app/Contents/MacOS/cantor  -Wl,-rpath,/Users/user/kde/build/kde/applications/cantor/work/Release-master/src/lib -Wl,-rpath,/Users/user/kde/build/kde/applications/cantor/work/Release-master/src -Wl,-rpath,/Users/user/kde/lib src/lib/libcantorlibs.19.07.70.dylib src/libcantor_config.dylib /Users/user/kde/lib/libKF5KIOFileWidgets.5.55.0.dylib /Users/user/kde/lib/libKF5Bookmarks.5.55.0.dylib /Users/user/kde/lib/libKF5Solid.5.55.0.dylib /Users/user/kde/lib/libKF5Parts.5.55.0.dylib /Users/user/kde/lib/libKF5NewStuff.5.55.0.dylib /Users/user/kde/lib/libKF5XmlGui.5.55.0.dylib /Users/user/kde/lib/libKF5KIOWidgets.5.55.0.dylib /Users/user/kde/lib/libKF5JobWidgets.5.55.0.dylib /Users/user/kde/lib/libKF5TextWidgets.5.55.0.dylib /Users/user/kde/lib/libKF5SonnetUi.5.55.0.dylib /Users/user/kde/lib/libKF5NewStuffCore.5.55.0.dylib /Users/user/kde/lib/libKF5Attica.5.55.0.dylib /Users/user/kde/lib/libKF5Completion.5.55.0.dylib /Users/user/kde/lib/libKF5IconThemes.5.55.0.dylib /Users/user/kde/lib/libKF5ConfigWidgets.5.55.0.dylib /Users/user/kde/lib/libKF5ConfigGui.5.55.0.dylib /Users/user/kde/lib/libKF5Codecs.5.55.0.dylib /Users/user/kde/lib/libKF5Archive.5.55.0.dylib /Users/user/kde/lib/libKF5WidgetsAddons.5.55.0.dylib /Users/user/kde/lib/libKF5KIOCore.5.55.0.dylib /Users/user/kde/lib/libKF5Crash.5.55.0.dylib /Users/user/kde/lib/libKF5Service.5.55.0.dylib /Users/user/kde/lib/libKF5ConfigCore.5.55.0.dylib /Users/user/kde/lib/QtXml.framework/QtXml /Users/user/kde/lib/QtNetwork.framework/QtNetwork /Users/user/kde/lib/libKF5Auth.5.55.0.dylib /Users/user/kde/lib/libKF5CoreAddons.5.55.0.dylib /Users/user/kde/lib/QtDBus.framework/QtDBus /Users/user/kde/lib/QtConcurrent.framework/QtConcurrent /Users/user/kde/lib/libKF5I18n.5.55.0.dylib /Users/user/kde/lib/libKF5ItemViews.5.55.0.dylib /Users/user/kde/lib/QtWidgets.framework/QtWidgets /Users/user/kde/lib/QtGui.framework/QtGui /Users/user/kde/lib/QtCore.framework/QtCore && :
Undefined symbols for architecture x86_64:
  "Cantor::PanelPlugin::setParentWidget(QWidget*)", referenced from:
      CantorShell::updatePanel() in cantor.cpp.o
  "Cantor::PanelPlugin::name()", referenced from:
      CantorShell::updatePanel() in cantor.cpp.o
  "Cantor::PanelPluginHandler::staticMetaObject", referenced from:
      CantorShell::updatePanel() in cantor.cpp.o
  "Cantor::PanelPluginHandler::plugins()", referenced from:
      CantorShell::updatePanel() in cantor.cpp.o
  "Cantor::WorksheetAccessInterface::staticMetaObject", referenced from:
      CantorShell::currentWorksheetAccessInterface() in cantor.cpp.o
  "Cantor::WorksheetAccessInterface::Name", referenced from:
      CantorShell::currentWorksheetAccessInterface() in cantor.cpp.o
  "Cantor::Backend::getBackend(QString const&)", referenced from:
      CantorShell::addWorksheet(QString const&) in cantor.cpp.o
      BackendChooseDialog::updateDescription() in backendchoosedialog.cpp.o
  "Cantor::Backend::availableBackends()", referenced from:
      CantorShell::hasAvailableBackend() in cantor.cpp.o
      CantorShell::addWorksheet() in cantor.cpp.o
      CantorShell::updatePanel() in cantor.cpp.o
      CantorShell::showSettings() in cantor.cpp.o
      BackendChooseDialog::BackendChooseDialog(QWidget*) in backendchoosedialog.cpp.o
  "Cantor::Backend::listAvailableBackends()", referenced from:
      CantorShell::showSettings() in cantor.cpp.o
  "Cantor::Backend::url() const", referenced from:
      CantorShell::addWorksheet() in cantor.cpp.o
      BackendChooseDialog::updateDescription() in backendchoosedialog.cpp.o
  "Cantor::Backend::icon() const", referenced from:
      CantorShell::addWorksheet(QString const&) in cantor.cpp.o
      CantorShell::updatePanel() in cantor.cpp.o
      CantorShell::showSettings() in cantor.cpp.o
      BackendChooseDialog::BackendChooseDialog(QWidget*) in backendchoosedialog.cpp.o
  "Cantor::Backend::name() const", referenced from:
      CantorShell::addWorksheet() in cantor.cpp.o
      CantorShell::updatePanel() in cantor.cpp.o
      CantorShell::showSettings() in cantor.cpp.o
      BackendChooseDialog::BackendChooseDialog(QWidget*) in backendchoosedialog.cpp.o
      BackendChooseDialog::updateDescription() in backendchoosedialog.cpp.o
  "Cantor::Backend::isEnabled() const", referenced from:
      CantorShell::addWorksheet(QString const&) in cantor.cpp.o
      CantorShell::hasAvailableBackend() in cantor.cpp.o
      CantorShell::updatePanel() in cantor.cpp.o
      BackendChooseDialog::BackendChooseDialog(QWidget*) in backendchoosedialog.cpp.o
ld: symbol(s) not found for architecture x86_64
Comment 1 Nikita Sirgienko 2019-03-26 18:24:03 UTC
Egh, I have no ideas, why it happends. Both failed builds used clang compiler?
Comment 2 Alexander Semke 2019-03-31 21:16:36 UTC
The error is probably because of the symbol visibility. We need to check the default behavior of clang and adjust the definition of CANTOR_EXPORT in cantor_export.h accordingly, if required.
Comment 3 Stefan Gerlach 2019-05-25 10:11:27 UTC
Problem vanished after update to macOS 10.14. If there is a bug, it's probably not relevant anymore.