【发布时间】:2012-03-29 07:50:33
【问题描述】:
我在OSX Leopard 上使用Qt4.8 而不是qmake+QtCreator 我想在OSX 上使用CMake 编译一个非常简单的project 以了解如何做一个包。
虽然同一个项目在 Linux 下可以顺利编译和链接,但在我的 OSX 机器下,这是我在链接阶段总是收到的错误消息:
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:
等等等等。
我想用 cmake 编译的每个项目都会发生这种情况。 知道发生了什么吗?
【问题讨论】:
标签: macos qt linker cmake osx-leopard