cmake链接错误 - 订单依赖还是其他什么?

时间:2015-04-22 21:00:07

标签: cmake g++

我正在尝试在Ubuntu 14.04上构建Sigil。它编译但不会链接。

我看过this(错误看起来非常像我所看到的)和this。我确信我找到了罪魁祸首,但是当我查看构建文件时,Python库已经在链接顺序中排在最后:

kevin@aphrodite:~/src/Sigil$ grep -r 'target_link_libraries' .
./src/CMakeLists.txt~:target_link_libraries( ${PROJECT_NAME} ${QT_MAIN} ${HUNSPELL_LIBRARIES} ${PCRE_LIBRARIES} gumbo ${MINIZIP_LIBRARIES} ${BOOST_LIBS} ${XERCES_LIBRARIES} ${XERCESEXTENSIONS_LIBRARIES} ${PYTHON_LIBRARIES} )
./src/CMakeLists.txt:target_link_libraries( ${PROJECT_NAME} ${QT_MAIN} ${HUNSPELL_LIBRARIES} ${PCRE_LIBRARIES} gumbo ${MINIZIP_LIBRARIES} ${BOOST_LIBS} ${XERCES_LIBRARIES} ${XERCESEXTENSIONS_LIBRARIES} ${PYTHON_LIBRARIES} )
./3rdparty/minizip/CMakeLists.txt:target_link_libraries( ${PROJECT_NAME} ${ZLIB_LIBRARIES} )
./cmake_extras/FindPythonLibs.cmake:#    target_link_libraries(${_NAME} ${PYTHON_LIBRARIES})

我对cmake不太熟悉,所以我很难过。我能想到的另一件事就是我安装了两个不同版本的Python(2.7和3.4),因为一堆核心Ubuntu软件包需要2.x而Sigil需要3.x.如果那是问题,我不知道该怎么办。

这是构建命令,它成功了:

cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=/home/kevin/local/qt/5.4/gcc_64/lib/cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_LIBRARY=/usr/bin/python3.4 -DFORCE_BUNDLED_COPIES=1 /home/kevin/src/Sigil

这是link命令,失败了。这里有吸烟枪吗?

kevin@aphrodite:~/src/Sigil$ make linuxbinpkg
[  1%] Automatic moc for target sigil
[  1%] Built target sigil_automoc
[  5%] Built target gumbo
[ 10%] Built target zlib
[ 13%] Built target hunspell
[ 14%] Built target minizip
[ 21%] Built target pcre
Linking CXX executable ../bin/sigil
/usr/bin/ld: error in /usr/bin/python3.4(.eh_frame); no .eh_frame_hdr table will be created.
CMakeFiles/sigil.dir/Misc/EmbeddedPython.cpp.o: In function `EmbeddedPython::instance()':
EmbeddedPython.cpp:(.text+0x26): undefined reference to `Py_Initialize'
EmbeddedPython.cpp:(.text+0x2b): undefined reference to `PyEval_InitThreads'
EmbeddedPython.cpp:(.text+0x30): undefined reference to `PyEval_SaveThread'
CMakeFiles/sigil.dir/Misc/EmbeddedPython.cpp.o: In function `EmbeddedPython::EmbeddedPython()':
EmbeddedPython.cpp:(.text+0x127): undefined reference to `Py_Initialize'
EmbeddedPython.cpp:(.text+0x12c): undefined reference to `PyEval_InitThreads'
EmbeddedPython.cpp:(.text+0x131): undefined reference to `PyEval_SaveThread'
CMakeFiles/sigil.dir/Misc/EmbeddedPython.cpp.o: In function `EmbeddedPython::~EmbeddedPython()':
EmbeddedPython.cpp:(.text+0x24e): undefined reference to `PyEval_RestoreThread'
EmbeddedPython.cpp:(.text+0x253): undefined reference to `Py_Finalize'
EmbeddedPython.cpp:(.text+0x27c): undefined reference to `PyEval_RestoreThread'
EmbeddedPython.cpp:(.text+0x281): undefined reference to `Py_Finalize'
EmbeddedPython.cpp:(.text+0x2aa): undefined reference to `PyEval_RestoreThread'
EmbeddedPython.cpp:(.text+0x2af): undefined reference to `Py_Finalize'
EmbeddedPython.cpp:(.text+0x2d8): undefined reference to `PyEval_RestoreThread'
EmbeddedPython.cpp:(.text+0x2dd): undefined reference to `Py_Finalize'
EmbeddedPython.cpp:(.text+0x306): undefined reference to `PyEval_RestoreThread'
CMakeFiles/sigil.dir/Misc/EmbeddedPython.cpp.o: In function `EmbeddedPython::addToPythonSysPath(QString const&)':
EmbeddedPython.cpp:(.text+0x32a): undefined reference to `PyGILState_Ensure'
EmbeddedPython.cpp:(.text+0x339): undefined reference to `PySys_GetObject'
EmbeddedPython.cpp:(.text+0x35c): undefined reference to `PyUnicode_FromString'
EmbeddedPython.cpp:(.text+0x38d): undefined reference to `PyList_Append'
EmbeddedPython.cpp:(.text+0x3b6): undefined reference to `PyGILState_Release'
CMakeFiles/sigil.dir/Misc/EmbeddedPython.cpp.o: In function `EmbeddedPython::QVariantToPyObject(QVariant&)':
EmbeddedPython.cpp:(.text+0xd97): undefined reference to `Py_BuildValue'
EmbeddedPython.cpp:(.text+0xdc9): undefined reference to `Py_BuildValue'
EmbeddedPython.cpp:(.text+0xdeb): undefined reference to `Py_BuildValue'
EmbeddedPython.cpp:(.text+0xe0e): undefined reference to `Py_BuildValue'
EmbeddedPython.cpp:(.text+0xe31): undefined reference to `Py_BuildValue'
CMakeFiles/sigil.dir/Misc/EmbeddedPython.cpp.o:EmbeddedPython.cpp:(.text+0xe57): more undefined references to `Py_BuildValue' follow
CMakeFiles/sigil.dir/Misc/EmbeddedPython.cpp.o: In function `EmbeddedPython::QVariantToPyObject(QVariant&)':
EmbeddedPython.cpp:(.text+0xe82): undefined reference to `PyList_New'
EmbeddedPython.cpp:(.text+0xeff): undefined reference to `PyList_SetItem'
EmbeddedPython.cpp:(.text+0x103d): undefined reference to `PyUnicode_FromKindAndData'
EmbeddedPython.cpp:(.text+0x10a4): undefined reference to `PyList_New'
EmbeddedPython.cpp:(.text+0x114e): undefined reference to `PyUnicode_FromKindAndData'
EmbeddedPython.cpp:(.text+0x115c): undefined reference to `PyList_SetItem'
EmbeddedPython.cpp:(.text+0x124b): undefined reference to `Py_BuildValue'
EmbeddedPython.cpp:(.text+0x1299): undefined reference to `Py_BuildValue'
CMakeFiles/sigil.dir/Misc/EmbeddedPython.cpp.o: In function `EmbeddedPython::PyObjectToQVariant(_object*, bool)':
EmbeddedPython.cpp:(.text+0x179a): undefined reference to `PyFloat_Type'
EmbeddedPython.cpp:(.text+0x17a8): undefined reference to `PyType_IsSubtype'
EmbeddedPython.cpp:(.text+0x180a): undefined reference to `PyUnicode_AsUTF8'
EmbeddedPython.cpp:(.text+0x1944): undefined reference to `PyFloat_AsDouble'
EmbeddedPython.cpp:(.text+0x19e4): undefined reference to `PyLong_AsLongLong'
EmbeddedPython.cpp:(.text+0x1bec): undefined reference to `PyBytes_AsString'
EmbeddedPython.cpp:(.text+0x1dd4): undefined reference to `_PyUnicode_Ready'
EmbeddedPython.cpp:(.text+0x1e03): undefined reference to `PyTuple_Size'
EmbeddedPython.cpp:(.text+0x1e2f): undefined reference to `PyTuple_GetItem'
EmbeddedPython.cpp:(.text+0x1f8b): undefined reference to `PyList_Size'
EmbeddedPython.cpp:(.text+0x1fb7): undefined reference to `PyList_GetItem'
CMakeFiles/sigil.dir/Misc/EmbeddedPython.cpp.o: In function `EmbeddedPython::getPythonErrorTraceback(bool)':
EmbeddedPython.cpp:(.text+0x25e0): undefined reference to `PyErr_Fetch'
EmbeddedPython.cpp:(.text+0x25f3): undefined reference to `PyErr_NormalizeException'
EmbeddedPython.cpp:(.text+0x2604): undefined reference to `PyImport_ImportModule'
EmbeddedPython.cpp:(.text+0x263c): undefined reference to `PyObject_CallMethod'
EmbeddedPython.cpp:(.text+0x2793): undefined reference to `PyErr_Clear'
CMakeFiles/sigil.dir/Misc/EmbeddedPython.cpp.o: In function `EmbeddedPython::runInPython(QString const&, QString const&, QList<QVariant> const&, int*, QString&, bool)':
EmbeddedPython.cpp:(.text+0x2b52): undefined reference to `PyGILState_Ensure'
EmbeddedPython.cpp:(.text+0x2bbc): undefined reference to `PyUnicode_FromString'
EmbeddedPython.cpp:(.text+0x2bee): undefined reference to `PyImport_Import'
EmbeddedPython.cpp:(.text+0x2c1b): undefined reference to `PyObject_GetAttrString'
EmbeddedPython.cpp:(.text+0x2c54): undefined reference to `PyCallable_Check'
EmbeddedPython.cpp:(.text+0x2c71): undefined reference to `PyErr_Occurred'
EmbeddedPython.cpp:(.text+0x2d37): undefined reference to `PyGILState_Release'
EmbeddedPython.cpp:(.text+0x2e9f): undefined reference to `PyTuple_New'
EmbeddedPython.cpp:(.text+0x2f35): undefined reference to `PyTuple_SetItem'
EmbeddedPython.cpp:(.text+0x3005): undefined reference to `PyObject_CallObject'
CMakeFiles/sigil.dir/Misc/EmbeddedPython.cpp.o: In function `EmbeddedPython::callPyObjMethod(PyObjectPtr&, QString const&, QList<QVariant> const&, int*, QString&, bool)':
EmbeddedPython.cpp:(.text+0x318d): undefined reference to `PyGILState_Ensure'
EmbeddedPython.cpp:(.text+0x31f4): undefined reference to `PyObject_GetAttrString'
EmbeddedPython.cpp:(.text+0x3226): undefined reference to `PyCallable_Check'
EmbeddedPython.cpp:(.text+0x3243): undefined reference to `PyErr_Occurred'
EmbeddedPython.cpp:(.text+0x32cd): undefined reference to `PyGILState_Release'
EmbeddedPython.cpp:(.text+0x33b9): undefined reference to `PyTuple_New'
EmbeddedPython.cpp:(.text+0x3437): undefined reference to `PyTuple_SetItem'
EmbeddedPython.cpp:(.text+0x34f6): undefined reference to `PyObject_CallObject'
CMakeFiles/sigil.dir/Misc/EmbeddedPython.cpp.o: In function `EmbeddedPython::~EmbeddedPython()':
EmbeddedPython.cpp:(.text+0x30c): undefined reference to `Py_Finalize'
CMakeFiles/sigil.dir/Misc/PyObjectPtr.cpp.o: In function `PyObjectPtr::~PyObjectPtr()':
PyObjectPtr.cpp:(.text+0x1f): undefined reference to `PyGILState_Ensure'
CMakeFiles/sigil.dir/Misc/PyObjectPtr.cpp.o: In function `PyObjectPtr::setNewRef(_object*)':
PyObjectPtr.cpp:(.text+0x8a): undefined reference to `PyGILState_Ensure'
PyObjectPtr.cpp:(.text+0xa3): undefined reference to `PyGILState_Release'
CMakeFiles/sigil.dir/Misc/PyObjectPtr.cpp.o: In function `PyObjectPtr::fromVariant(QVariant const&)':
PyObjectPtr.cpp:(.text+0x14d): undefined reference to `PyGILState_Ensure'
PyObjectPtr.cpp:(.text+0x16c): undefined reference to `PyGILState_Release'
PyObjectPtr.cpp:(.text+0x183): undefined reference to `PyGILState_Ensure'
PyObjectPtr.cpp:(.text+0x1a4): undefined reference to `PyGILState_Release'
PyObjectPtr.cpp:(.text+0x1c0): undefined reference to `PyGILState_Ensure'
PyObjectPtr.cpp:(.text+0x1df): undefined reference to `PyGILState_Release'
PyObjectPtr.cpp:(.text+0x203): undefined reference to `PyGILState_Ensure'
PyObjectPtr.cpp:(.text+0x220): undefined reference to `PyGILState_Release'
CMakeFiles/sigil.dir/Misc/PyObjectPtr.cpp.o: In function `PyObjectPtr::setObject(_object*)':
PyObjectPtr.cpp:(.text+0x42a): undefined reference to `PyGILState_Ensure'
PyObjectPtr.cpp:(.text+0x444): undefined reference to `PyGILState_Release'
CMakeFiles/sigil.dir/Misc/PyObjectPtr.cpp.o: In function `PyObjectPtr::~PyObjectPtr()':
PyObjectPtr.cpp:(.text+0x3d): undefined reference to `PyGILState_Release'
PyObjectPtr.cpp:(.text+0x5f): undefined reference to `PyGILState_Release'
CMakeFiles/sigil.dir/Misc/PyObjectPtr.cpp.o: In function `QtMetaTypePrivate::QMetaTypeFunctionHelper<PyObjectPtr, true>::Destruct(void*)':
PyObjectPtr.cpp:(.text._ZN17QtMetaTypePrivate23QMetaTypeFunctionHelperI11PyObjectPtrLb1EE8DestructEPv[_ZN17QtMetaTypePrivate23QMetaTypeFunctionHelperI11PyObjectPtrLb1EE8DestructEPv]+0xf): undefined reference to `PyGILState_Ensure'
PyObjectPtr.cpp:(.text._ZN17QtMetaTypePrivate23QMetaTypeFunctionHelperI11PyObjectPtrLb1EE8DestructEPv[_ZN17QtMetaTypePrivate23QMetaTypeFunctionHelperI11PyObjectPtrLb1EE8DestructEPv]+0x2d): undefined reference to `PyGILState_Release'
PyObjectPtr.cpp:(.text._ZN17QtMetaTypePrivate23QMetaTypeFunctionHelperI11PyObjectPtrLb1EE8DestructEPv[_ZN17QtMetaTypePrivate23QMetaTypeFunctionHelperI11PyObjectPtrLb1EE8DestructEPv]+0x4f): undefined reference to `PyGILState_Release'
CMakeFiles/sigil.dir/Misc/PyObjectPtr.cpp.o: In function `QtMetaTypePrivate::QMetaTypeFunctionHelper<PyObjectPtr, true>::Delete(void*)':
PyObjectPtr.cpp:(.text._ZN17QtMetaTypePrivate23QMetaTypeFunctionHelperI11PyObjectPtrLb1EE6DeleteEPv[_ZN17QtMetaTypePrivate23QMetaTypeFunctionHelperI11PyObjectPtrLb1EE6DeleteEPv]+0x14): undefined reference to `PyGILState_Ensure'
PyObjectPtr.cpp:(.text._ZN17QtMetaTypePrivate23QMetaTypeFunctionHelperI11PyObjectPtrLb1EE6DeleteEPv[_ZN17QtMetaTypePrivate23QMetaTypeFunctionHelperI11PyObjectPtrLb1EE6DeleteEPv]+0x2d): undefined reference to `PyGILState_Release'
collect2: error: ld returned 1 exit status
make[3]: *** [bin/sigil] Error 1
make[2]: *** [src/CMakeFiles/sigil.dir/all] Error 2
make[1]: *** [src/CMakeFiles/linuxbinpkg.dir/rule] Error 2
make: *** [linuxbinpkg] Error 2

以下是失败部分的详细输出:

Linking CXX executable ../bin/sigil
cd /home/kevin/src/Sigil/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/sigil.dir/link.txt --verbose=1
/usr/bin/c++    -std=c++11 -O3 -DNDEBUG   CMakeFiles/sigil.dir/sigil_constants.cpp.o CMakeFiles/sigil.dir/main.cpp.o CMakeFiles/sigil.dir/Tabs/TabBar.cpp.o CMakeFiles/sigil.dir/Tabs/TabManager.cpp.o CMakeFiles/sigil.dir/Tabs/FlowTab.cpp.o CMakeFiles/sigil.dir/Tabs/ContentTab.cpp.o CMakeFiles/sigil.dir/Tabs/TextTab.cpp.o CMakeFiles/sigil.dir/Tabs/CSSTab.cpp.o CMakeFiles/sigil.dir/Tabs/AVTab.cpp.o CMakeFiles/sigil.dir/Tabs/ImageTab.cpp.o CMakeFiles/sigil.dir/Tabs/MiscTextTab.cpp.o CMakeFiles/sigil.dir/Tabs/SVGTab.cpp.o CMakeFiles/sigil.dir/Tabs/OPFTab.cpp.o CMakeFiles/sigil.dir/Tabs/NCXTab.cpp.o CMakeFiles/sigil.dir/Tabs/WellFormedCheckComponent.cpp.o CMakeFiles/sigil.dir/Tabs/XMLTab.cpp.o CMakeFiles/sigil.dir/SourceUpdates/PerformHTMLUpdates.cpp.o CMakeFiles/sigil.dir/SourceUpdates/PerformOPFUpdates.cpp.o CMakeFiles/sigil.dir/SourceUpdates/PerformNCXUpdates.cpp.o CMakeFiles/sigil.dir/SourceUpdates/PerformCSSUpdates.cpp.o CMakeFiles/sigil.dir/SourceUpdates/AnchorUpdates.cpp.o CMakeFiles/sigil.dir/SourceUpdates/LinkUpdates.cpp.o CMakeFiles/sigil.dir/SourceUpdates/WordUpdates.cpp.o CMakeFiles/sigil.dir/SourceUpdates/UniversalUpdates.cpp.o CMakeFiles/sigil.dir/BookManipulation/Book.cpp.o CMakeFiles/sigil.dir/BookManipulation/BookReports.cpp.o CMakeFiles/sigil.dir/BookManipulation/Index.cpp.o CMakeFiles/sigil.dir/BookManipulation/CleanSource.cpp.o CMakeFiles/sigil.dir/BookManipulation/FolderKeeper.cpp.o CMakeFiles/sigil.dir/BookManipulation/Headings.cpp.o CMakeFiles/sigil.dir/BookManipulation/Metadata.cpp.o CMakeFiles/sigil.dir/BookManipulation/XhtmlDoc.cpp.o CMakeFiles/sigil.dir/BookManipulation/GuideSemantics.cpp.o CMakeFiles/sigil.dir/ResourceObjects/Resource.cpp.o CMakeFiles/sigil.dir/ResourceObjects/TextResource.cpp.o CMakeFiles/sigil.dir/ResourceObjects/HTMLResource.cpp.o CMakeFiles/sigil.dir/ResourceObjects/CSSResource.cpp.o CMakeFiles/sigil.dir/ResourceObjects/ImageResource.cpp.o CMakeFiles/sigil.dir/ResourceObjects/AudioResource.cpp.o CMakeFiles/sigil.dir/ResourceObjects/VideoResource.cpp.o CMakeFiles/sigil.dir/ResourceObjects/MiscTextResource.cpp.o CMakeFiles/sigil.dir/ResourceObjects/SVGResource.cpp.o CMakeFiles/sigil.dir/ResourceObjects/FontResource.cpp.o CMakeFiles/sigil.dir/ResourceObjects/OPFParser.cpp.o CMakeFiles/sigil.dir/ResourceObjects/OPFResource.cpp.o CMakeFiles/sigil.dir/ResourceObjects/NCXResource.cpp.o CMakeFiles/sigil.dir/ResourceObjects/XMLResource.cpp.o CMakeFiles/sigil.dir/Dialogs/About.cpp.o CMakeFiles/sigil.dir/Dialogs/AddMetadata.cpp.o CMakeFiles/sigil.dir/Dialogs/ClipboardHistorySelector.cpp.o CMakeFiles/sigil.dir/Dialogs/DeleteFiles.cpp.o CMakeFiles/sigil.dir/Dialogs/DeleteStyles.cpp.o CMakeFiles/sigil.dir/Dialogs/EditTOC.cpp.o CMakeFiles/sigil.dir/Dialogs/OpenWithName.cpp.o CMakeFiles/sigil.dir/Dialogs/SelectCharacter.cpp.o CMakeFiles/sigil.dir/Dialogs/SelectHyperlink.cpp.o CMakeFiles/sigil.dir/Dialogs/SelectId.cpp.o CMakeFiles/sigil.dir/Dialogs/SelectIndexTitle.cpp.o CMakeFiles/sigil.dir/Dialogs/SelectFiles.cpp.o CMakeFiles/sigil.dir/Dialogs/MetaEditor.cpp.o CMakeFiles/sigil.dir/Dialogs/MetaEditorItemDelegate.cpp.o CMakeFiles/sigil.dir/Dialogs/HeadingSelector.cpp.o CMakeFiles/sigil.dir/Dialogs/PluginRunner.cpp.o CMakeFiles/sigil.dir/Dialogs/Preferences.cpp.o CMakeFiles/sigil.dir/Dialogs/PreferenceWidgets/AppearanceWidget.cpp.o CMakeFiles/sigil.dir/Dialogs/PreferenceWidgets/CleanSourceWidget.cpp.o CMakeFiles/sigil.dir/Dialogs/PreferenceWidgets/KeyboardShortcutsWidget.cpp.o CMakeFiles/sigil.dir/Dialogs/PreferenceWidgets/LanguageWidget.cpp.o CMakeFiles/sigil.dir/Dialogs/PreferenceWidgets/SpellCheckWidget.cpp.o CMakeFiles/sigil.dir/Dialogs/PreferenceWidgets/PreserveEntitiesWidget.cpp.o CMakeFiles/sigil.dir/Dialogs/PreferenceWidgets/PluginWidget.cpp.o CMakeFiles/sigil.dir/Dialogs/RenameTemplate.cpp.o CMakeFiles/sigil.dir/Dialogs/Reports.cpp.o CMakeFiles/sigil.dir/Dialogs/ReportsWidgets/AllFilesWidget.cpp.o CMakeFiles/sigil.dir/Dialogs/ReportsWidgets/HTMLFilesWidget.cpp.o CMakeFiles/sigil.dir/Dialogs/ReportsWidgets/LinksWidget.cpp.o CMakeFiles/sigil.dir/Dialogs/ReportsWidgets/ImageFilesWidget.cpp.o CMakeFiles/sigil.dir/Dialogs/ReportsWidgets/CSSFilesWidget.cpp.o CMakeFiles/sigil.dir/Dialogs/ReportsWidgets/ClassesInHTMLFilesWidget.cpp.o CMakeFiles/sigil.dir/Dialogs/ReportsWidgets/StylesInCSSFilesWidget.cpp.o CMakeFiles/sigil.dir/Dialogs/ReportsWidgets/CharactersInHTMLFilesWidget.cpp.o CMakeFiles/sigil.dir/Dialogs/LinkStylesheets.cpp.o CMakeFiles/sigil.dir/Dialogs/SearchEditor.cpp.o CMakeFiles/sigil.dir/Dialogs/ClipEditor.cpp.o CMakeFiles/sigil.dir/Dialogs/IndexEditor.cpp.o CMakeFiles/sigil.dir/Dialogs/SpellcheckEditor.cpp.o CMakeFiles/sigil.dir/Dialogs/ViewImage.cpp.o CMakeFiles/sigil.dir/Exporters/ExportEPUB.cpp.o CMakeFiles/sigil.dir/Exporters/ExporterFactory.cpp.o CMakeFiles/sigil.dir/Exporters/NCXWriter.cpp.o CMakeFiles/sigil.dir/Exporters/XMLWriter.cpp.o CMakeFiles/sigil.dir/Exporters/EncryptionXmlWriter.cpp.o CMakeFiles/sigil.dir/Importers/ImportEPUB.cpp.o CMakeFiles/sigil.dir/Importers/Importer.cpp.o CMakeFiles/sigil.dir/Importers/ImporterFactory.cpp.o CMakeFiles/sigil.dir/Importers/ImportHTML.cpp.o CMakeFiles/sigil.dir/Importers/ImportTXT.cpp.o CMakeFiles/sigil.dir/Misc/AppEventFilter.cpp.o CMakeFiles/sigil.dir/Misc/UpdateChecker.cpp.o CMakeFiles/sigil.dir/Misc/Utility.cpp.o CMakeFiles/sigil.dir/Misc/FindReplaceQLineEdit.cpp.o CMakeFiles/sigil.dir/Misc/FilenameDelegate.cpp.o CMakeFiles/sigil.dir/Misc/XHTMLHighlighter.cpp.o CMakeFiles/sigil.dir/Misc/CSSHighlighter.cpp.o CMakeFiles/sigil.dir/Misc/CSSInfo.cpp.o CMakeFiles/sigil.dir/Misc/HTMLEncodingResolver.cpp.o CMakeFiles/sigil.dir/Misc/HTMLSpellCheck.cpp.o CMakeFiles/sigil.dir/Misc/HTMLPrettyPrint.cpp.o CMakeFiles/sigil.dir/Misc/PasteTargetComboBox.cpp.o CMakeFiles/sigil.dir/Misc/Plugin.cpp.o CMakeFiles/sigil.dir/Misc/PluginDB.cpp.o CMakeFiles/sigil.dir/Misc/QCodePage437Codec.cpp.o CMakeFiles/sigil.dir/Misc/RasterizeImageResource.cpp.o CMakeFiles/sigil.dir/Misc/SearchOperations.cpp.o CMakeFiles/sigil.dir/Misc/Language.cpp.o CMakeFiles/sigil.dir/Misc/UILanguage.cpp.o CMakeFiles/sigil.dir/Misc/SettingsStore.cpp.o CMakeFiles/sigil.dir/Misc/SpellCheck.cpp.o CMakeFiles/sigil.dir/Misc/KeyboardShortcut.cpp.o CMakeFiles/sigil.dir/Misc/KeyboardShortcutManager.cpp.o CMakeFiles/sigil.dir/Misc/XhtmlEntitiesDtd.cpp.o CMakeFiles/sigil.dir/Misc/Ncx20051Dtd.cpp.o CMakeFiles/sigil.dir/Misc/FontObfuscation.cpp.o CMakeFiles/sigil.dir/Misc/TempFolder.cpp.o CMakeFiles/sigil.dir/Misc/OpenExternally.cpp.o CMakeFiles/sigil.dir/Misc/TOCHTMLWriter.cpp.o CMakeFiles/sigil.dir/Misc/ValidationResult.cpp.o CMakeFiles/sigil.dir/Misc/XMLEntities.cpp.o CMakeFiles/sigil.dir/Misc/PyObjectPtr.cpp.o CMakeFiles/sigil.dir/Misc/EmbeddedPython.cpp.o CMakeFiles/sigil.dir/Misc/GumboInterface.cpp.o CMakeFiles/sigil.dir/MiscEditors/ClipEditorModel.cpp.o CMakeFiles/sigil.dir/MiscEditors/ClipEditorTreeView.cpp.o CMakeFiles/sigil.dir/MiscEditors/IndexEditorModel.cpp.o CMakeFiles/sigil.dir/MiscEditors/IndexEditorTreeView.cpp.o CMakeFiles/sigil.dir/MiscEditors/IndexEntries.cpp.o CMakeFiles/sigil.dir/MiscEditors/IndexHTMLWriter.cpp.o CMakeFiles/sigil.dir/MiscEditors/SearchEditorTreeView.cpp.o CMakeFiles/sigil.dir/MiscEditors/SearchEditorModel.cpp.o CMakeFiles/sigil.dir/pcre/SPCRE.cpp.o CMakeFiles/sigil.dir/pcre/PCRECache.cpp.o CMakeFiles/sigil.dir/pcre/PCREReplaceTextBuilder.cpp.o CMakeFiles/sigil.dir/ViewEditors/BookViewEditor.cpp.o CMakeFiles/sigil.dir/ViewEditors/BookViewPreview.cpp.o CMakeFiles/sigil.dir/ViewEditors/CodeViewEditor.cpp.o CMakeFiles/sigil.dir/ViewEditors/LineNumberArea.cpp.o CMakeFiles/sigil.dir/ViewEditors/Searchable.cpp.o CMakeFiles/sigil.dir/ViewEditors/ViewWebPage.cpp.o CMakeFiles/sigil.dir/MainUI/MainApplication.cpp.o CMakeFiles/sigil.dir/MainUI/MainWindow.cpp.o CMakeFiles/sigil.dir/MainUI/FindReplace.cpp.o CMakeFiles/sigil.dir/MainUI/BookBrowser.cpp.o CMakeFiles/sigil.dir/MainUI/ClipsWindow.cpp.o CMakeFiles/sigil.dir/MainUI/PreviewWindow.cpp.o CMakeFiles/sigil.dir/MainUI/TableOfContents.cpp.o CMakeFiles/sigil.dir/MainUI/OPFModel.cpp.o CMakeFiles/sigil.dir/MainUI/OPFModelItem.cpp.o CMakeFiles/sigil.dir/MainUI/NCXModel.cpp.o CMakeFiles/sigil.dir/MainUI/ValidationResultsView.cpp.o CMakeFiles/sigil.dir/qrc_main.cpp.o CMakeFiles/sigil.dir/qrc_About.cpp.o CMakeFiles/sigil.dir/qrc_javascript.cpp.o CMakeFiles/sigil.dir/qrc_icon.cpp.o CMakeFiles/sigil.dir/sigil_automoc.cpp.o  -o ../bin/sigil -rdynamic ../lib/libhunspell.a ../lib/libpcre.a ../lib/libgumbo.a ../lib/libminizip.a /usr/bin/python3.4 /home/kevin/local/qt/5.4/gcc_64/lib/libQt5Xml.so.5.4.1 /home/kevin/local/qt/5.4/gcc_64/lib/libQt5XmlPatterns.so.5.4.1 /home/kevin/local/qt/5.4/gcc_64/lib/libQt5PrintSupport.so.5.4.1 /home/kevin/local/qt/5.4/gcc_64/lib/libQt5Svg.so.5.4.1 /home/kevin/local/qt/5.4/gcc_64/lib/libQt5WebKitWidgets.so.5.4.1 /home/kevin/local/qt/5.4/gcc_64/lib/libQt5Concurrent.so.5.4.1 ../lib/libzlib.a /home/kevin/local/qt/5.4/gcc_64/lib/libQt5Widgets.so.5.4.1 /home/kevin/local/qt/5.4/gcc_64/lib/libQt5WebKit.so.5.4.1 /home/kevin/local/qt/5.4/gcc_64/lib/libQt5Network.so.5.4.1 /home/kevin/local/qt/5.4/gcc_64/lib/libQt5Gui.so.5.4.1 /home/kevin/local/qt/5.4/gcc_64/lib/libQt5Core.so.5.4.1 -Wl,-rpath,/home/kevin/local/qt/5.4/gcc_64/lib

2 个答案:

答案 0 :(得分:2)

作为起点,尝试手动输入以下命令行

  

[如果有兴趣,请参见编辑历史]

基本上我只用Python2.7取代了Python3.4;请仔细检查/ usr / bin中的库名称

我现在看到你有一个解决方案,根本问题是在CMakeLists.txt中,这一行

find_package (PythonLibs 3.4)

应该是:

find_package (PythonLibs 3.4 REQUIRED)

答案 1 :(得分:0)

安东尼奥打电话给message(STATUS "PYTHON_LIBRARIES = ${PYTHON_LIBRARIES}")打电话给我/ facepalm。

在我的cmake命令中,我放了-DPYTHON_LIBRARY=/usr/bin/python3.4。这是一个可执行文件,而不是库。我不确定导致我把它放在那里的事件的确切顺序,但我认为它是这样的:

  • 尝试使用仅安装了Python 2.7进行构建; cmake失败,因为找不到合适的Python版本。
  • 已安装的Python 3.4。如果我在这一点上再次尝试构建,可能它失败了,因为cmake并没有真正的“干净”选项,所以也许它被卡在Python 2.7上。
  • 放入虚假的图书馆路径。

所以cmake成功了,显然对它实际上没有用的任何虚假路径感到满意,只是在Makefile中写道。

在重新开始使用干净的项目树后,我看到了这条我以前从未见过的专栏:

Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.4m.so (found suitable version "3.4", minimum required is "3.4") 

现在make有效!