Qt4.8 + CMake 2.8.5 on OSX 10.5.8 can't link
-
27-05-2021 - |
Pergunta
I'm using Qt4.8 on OSX Leopard
and instead of qmake
+QtCreator
I want to compile a very simple project using CMake
on OSX to understand how to do a package.
While the very same project compiles and links smoothly under Linux, under my OSX box, this is the error message I always get in the linking phase:
ld warning: in /Library/Frameworks//QtGui.framework/QtGui, file is not of required architecture
ld warning: in /Library/Frameworks//QtCore.framework/QtCore, file is not of required architecture
Undefined symbols:
"QWidget::mousePressEvent(QMouseEvent*)", referenced from:
vtable for TestFormin moc_TestForm.cxx.o
"QObject::childEvent(QChildEvent*)", referenced from:
vtable for TestFormin moc_TestForm.cxx.o
"QWidget::actionEvent(QActionEvent*)", referenced from:
vtable for TestFormin moc_TestForm.cxx.o
"QCoreApplication::translate(char const*, char const*, char const*, QCoreApplication::Encoding)", referenced from:
etcetera etcetera.
This happens for every project I want to compile with cmake. Any idea of what's going on?
Solução
Check what architecture (i386
,x86_64
) is being used by cmake
(CMAKE_OSX_ARCHITECTURES
). Try suggesting the architecture to cmake
:
cmake -DCMAKE_OSX_ARCHITECTURES=x86_64
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow