簡體   English   中英

OSX 10.5.8上的Qt4.8 + CMake 2.8.5無法鏈接

[英]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進行編譯的每個項目,都會發生這種情況。 有什么想法嗎?

檢查cmakeCMAKE_OSX_ARCHITECTURES )正在使用什么體系結構( i386x86_64 )。 嘗試建議使用cmake的體系結構:

cmake -DCMAKE_OSX_ARCHITECTURES=x86_64

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM