1
在Mac上編譯我的QT應用程序時出現錯誤。 我跟着這tutorial所有的代碼是在頁面的底部。編譯Qt教程時出現「未定義的體系結構符號」鏈接器錯誤
當我建立這個項目,我得到以下幾點:
Undefined symbols for architecture x86_64:
"DiagramItem::addArrow(Arrow*)", referenced from:
DiagramScene::mouseReleaseEvent(QGraphicsSceneMouseEvent*) in diagramscene.o
"DiagramScene::setItemType(DiagramItem::DiagramType)", referenced from:
MainWindow::buttonGroupClicked(int) in mainwindow.o
DiagramScene::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) in moc_diagramscene.o
"DiagramScene::setTextColor(QColor const&)", referenced from:
MainWindow::textButtonTriggered() in mainwindow.o
"DiagramScene::setMode(DiagramScene::Mode)", referenced from:
MainWindow::buttonGroupClicked(int) in mainwindow.o
MainWindow::pointerGroupClicked(int) in mainwindow.o
MainWindow::itemInserted(DiagramItem*) in mainwindow.o
MainWindow::textInserted(QGraphicsTextItem&) in mainwindow.o
DiagramScene::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) in moc_diagramscene.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [DiagramScene.app/Contents/MacOS/DiagramScene] Error 1
18:41:52: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project DiagramScene (kit: Desktop)
When executing step 'Make'
任何人在此之前有什麼建議或見過?
在此先感謝。 :)
看起來你沒有鏈接到包含這些符號的文件。首先找到他們的實現文件,並檢查它正在編譯和鏈接的構建日誌。 – trojanfoe