[英]Qt4.8 + CMake 2.8.5 on OSX 10.5.8 can't link
我在OSX Leopard
上使用Qt4.8,而不是qmake
+ QtCreator
,而是想在OSX上使用CMake
編譯一個非常簡單的項目 ,以了解如何制作軟件包。
雖然同一項目在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:
etcetera等。
對於我要使用cmake進行編譯的每個項目,都會發生這種情況。 有什么想法嗎?
檢查cmake
( CMAKE_OSX_ARCHITECTURES
)正在使用什么體系結構( i386
, x86_64
)。 嘗試建議使用cmake
的體系結構:
cmake -DCMAKE_OSX_ARCHITECTURES=x86_64
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.