Makefile Cmake和make,编译scribus时出错

Makefile Cmake和make,编译scribus时出错,makefile,cmake,qmake,Makefile,Cmake,Qmake,我在尝试编译Scribus 1.5 svn时总是发现一个错误。我尝试了Qt4和Qt5,但错误似乎并不依赖于它们 这是cmake输出: cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/fabio/scribusinstall .. -DUSE_QT5=1 -DQT_PREFIX="/opt/qt5/bin" -- Shared Library Flags: -- Scribus 1.5.0.svn will be built to install into /ho

我在尝试编译Scribus 1.5 svn时总是发现一个错误。我尝试了Qt4和Qt5,但错误似乎并不依赖于它们

这是cmake输出:

cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/fabio/scribusinstall .. -DUSE_QT5=1 -DQT_PREFIX="/opt/qt5/bin"
-- Shared Library Flags: 
-- Scribus 1.5.0.svn will be built to install into /home/fabio/scribusinstall
-- Machine: x86_64-linux-gnu, void pointer size: 8
-- Found target X86
-- Found target X86_64
-- Building for target x86_64-linux-gnu
-- Using standard ApplicationDataDir. You can change it with -DAPPLICATION_DATA_DIR
-- ----- USE QT 5-----
-- ----- USE QT Widgets-----
-- ----- USE Qt5Gui -----
-- ----- USE QT 5 XML -----
-- ----- USE Qt5WebKit -----
-- ----- USE Qt5WebKitWidgets -----
-- ----- USE Qt5Network -----
-- ----- USE Qt5OpenGL -----
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so  
ZLIB Library Found OK
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so  
Using PNG Library: /usr/lib/x86_64-linux-gnu/libpng.so
PNG Library Found OK
OSG found OK
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so  
-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so  
JPEG Library Found OK
-- Found TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so  
TIFF Library Found OK
-- Found PythonLibs: /usr/lib/libpython2.7.so (found suitable version "2.7.3", required is "2") 
Python Library Found OK
-- Found Freetype: /usr/lib/x86_64-linux-gnu/libfreetype.so (found version "2.4.8") 
-- FreeType2 Library Found OK
-- Looking for FT_Get_First_Char in /usr/lib/x86_64-linux-gnu/libfreetype.so
-- Looking for FT_Get_First_Char in /usr/lib/x86_64-linux-gnu/libfreetype.so - found
-- Looking for FT_Get_Next_Char in /usr/lib/x86_64-linux-gnu/libfreetype.so
-- Looking for FT_Get_Next_Char in /usr/lib/x86_64-linux-gnu/libfreetype.so - found
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26") 
-- checking for one of the modules 'libcairo>=1.2.0;cairo>=1.2.0'
CAIRO Library Found OK
-- Found Cups: /usr/lib/x86_64-linux-gnu/libcups.so (found version "1.5.3") 
CUPS Library Found OK
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.7.8") 
LIBXML2 Library Found OK
LCMS ReleaseLibrary: /usr/lib/x86_64-linux-gnu/liblcms.so
LCMS Debug Library: LCMS_LIBRARY_DEBUG-NOTFOUND
LCMS Library: /usr/lib/x86_64-linux-gnu/liblcms.so
LCMS 2 ReleaseLibrary: LCMS2_LIBRARY_RELEASE-NOTFOUND
LCMS 2 Debug Library: LCMS2_LIBRARY_DEBUG-NOTFOUND
LCMS 2 Library: LCMS2_LIBRARY_RELEASE-NOTFOUND
LCMS ReleaseLibrary: /usr/lib/x86_64-linux-gnu/liblcms.so
LCMS Debug Library: LCMS_LIBRARY_DEBUG-NOTFOUND
LCMS Library: /usr/lib/x86_64-linux-gnu/liblcms.so
LittleCMS Library Found OK
-- checking for one of the modules 'fontconfig'
FontConfig Found OK
-- Could NOT find HUNSPELL (missing:  HUNSPELL_LIBRARIES HUNSPELL_INCLUDE_DIR) 
Hunspell or its developer libraries NOT found - Disabling support for spell checking
PoDoFo found OK
-- Boost version: 1.46.1
Boost Library Found OK
Building without GraphicksMagick (use -DWANT_GRAPHICSMAGICK=1 to enable)
-- checking for one of the modules 'libpoppler>=0.19.0;poppler>=0.19.0'
-- Found poppler
-- Found poppler libs: /usr/lib/x86_64-linux-gnu/libpoppler.so
-- Found poppler includes: /usr/include/poppler
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for include file endian.h
-- Looking for include file endian.h - found
-- Looking for include file fcntl.h
-- Looking for include file fcntl.h - found
RPATH: lib/scribus/plugins/;
-- Qt5::CoreQt5::WidgetsQt5::GuiQt5::XmlQt5::WebKitQt5::WebKitWidgetsQt5::NetworkQt5::OpenGL/usr/lib/x86_64-linux-gnu/libxml2.so/usr/lib/x86_64-linux-gnu/libz.so
-- Building with Scripter 1
-- Source header files will be installed
-- /home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/resources/translations/po
-- The following GUI languages will be installed: 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/builddir
那么我会:

cd ..
make
Scanning dependencies of target scribus_pgf_lib
[  0%] Building CXX object scribus/third_party/pgf/CMakeFiles/scribus_pgf_lib.dir/Decoder.cpp.o
<command-line>:0:1: error: macro names must be identifiers
/home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/scribus/third_party/pgf/Decoder.cpp:583:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
make[2]: *** [scribus/third_party/pgf/CMakeFiles/scribus_pgf_lib.dir/Decoder.cpp.o] Errore 1
make[1]: *** [scribus/third_party/pgf/CMakeFiles/scribus_pgf_lib.dir/all] Errore 2
make: *** [all] Errore 2

您可以从得到的错误开始:

<command-line>:0:1: error: macro names must be identifiers
您将得到完全相同的错误,因为
1
不是有效的标识符(有效标识符仅包含字母、数字和下划线;第一个字符不能是数字)。我无法仅凭您所拥有的推断更多,但您可以做的是搜索
Makefile
以查找无效的
-D
选项,并尝试查找
CMakeLists.txt
中可能生成此选项的部分

带有
-D
的宏定义通常通过以下命令
add\u definitions
从cmake文件中定义。例如,我可以通过将以下行添加到cmake中来传递我的易出错
-D1
选项:

add_definitions(-D1)
希望您能设法找出错误的原因

编辑:错误在这一行:

cd /home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/builddir/scribus/third_party/pgf && /usr/bin/c++   -DNDEBUG -DQT_CORE_LIB -DQT_WIDGETS_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_WEBKITWIDGETS_LIB -DQT_QUICK_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_LOCATION_LIB -DQT_SENSORS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_OPENGL_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DUSE_QT5 -DHAVE_DLFCN_H -DHAVE_UNISTD_H -DHAVE_CONFIG_H -O2 -Wall -fPIC -I/home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/builddir/scribus/third_party/pgf -I/home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/scribus/third_party/pgf -I/opt/qt5/include -I/opt/qt5/include/QtCore -I/opt/qt5/mkspecs/default -I/opt/qt5/include/QtWidgets -I/opt/qt5/include/QtGui -I/opt/qt5/include/QtXml -I/opt/qt5/include/QtWebKit -I/opt/qt5/include/QtOpenGL -I/opt/qt5/include/QtNetwork -I/usr/include/qt5 -I/usr/include/qt5/QtWebKitWidgets -I/usr/include/qt5/QtQuick -I/usr/include/qt5/QtQml -I/usr/include/qt5/QtPrintSupport -I/usr/include/qt5/QtLocation -I/usr/include/qt5/QtSensors -I/home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/builddir -I/home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/builddir/scribus -I/usr/include/libxml2 -I/home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810 -I/home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/scribus    -DSHAREDIR=\"/home/fabio/scribusinstall/share/scribus/\" -DDOCDIR=\"/home/fabio/scribusinstall/share/doc/scribus/\" -DICONDIR=\"/home/fabio/scribusinstall/share/scribus/icons/\" -DSAMPLESDIR=\"/home/fabio/scribusinstall/share/scribus/samples/\" -DSCRIPTSDIR=\"/home/fabio/scribusinstall/share/scribus/scripts/\" -DTEMPLATEDIR=\"/home/fabio/scribusinstall/share/scribus/templates/\" -DDESKTOPDIR=\"/home/fabio/scribusinstall/share/applications/\" -DLIBDIR=\"/home/fabio/scribusinstall/lib/scribus/\" -DPLUGINDIR=\"/home/fabio/scribusinstall/lib/scribus/plugins/\" -D -D -DCOMPILE_SCRIBUS_MAIN_APP -o CMakeFiles/scribus_pgf_lib.dir/Decoder.cpp.o -c /home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/scribus/third_party/pgf/Decoder.cpp

在该行的中间,有触发实际错误的选项
-D-D
。现在,问题是找到生成此命令行的原因以及如何更正:)

您可以发布
make VERBOSE=1
的输出吗?我还向Scribus社区询问,他们是否知道可能发生的错误,但似乎对他们来说没有问题。。应该可以按照:和可能的说明进行复制非常感谢,我将试着听从你的建议。我会尽快发布结果。我发布了我发现的唯一的二维定义,没有一个是无效的。谢谢!这是由cmake引起的还是由某些配置文件引起的?我无法理解这是如何发生的,因为我从apt get source下载了源代码,所以它应该可以工作,因为已经存在编译版本。。有没有可能我使用的cmake版本工作不正常?我搜索了很多文件,但我真的找不到-D前缀的来源。。你能给我推荐最可能的文件吗?在以下注释中,有我的ls输出:fabio@fabio-EasyNote-TS11HR~/ScribusSVN/scribus-trunk-1.5.0svn20130491180/builddir$ls CMakeCache.txt cmake_uninstall.cmake CPackSourceConfig.cmake resources CMakeFiles config.h doc scribus cmake_install.cmake CPackConfig.cmake Makefile
g++ foobar.cpp -D1
add_definitions(-D1)
cd /home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/builddir/scribus/third_party/pgf && /usr/bin/c++   -DNDEBUG -DQT_CORE_LIB -DQT_WIDGETS_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_WEBKITWIDGETS_LIB -DQT_QUICK_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_LOCATION_LIB -DQT_SENSORS_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_OPENGL_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DUSE_QT5 -DHAVE_DLFCN_H -DHAVE_UNISTD_H -DHAVE_CONFIG_H -O2 -Wall -fPIC -I/home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/builddir/scribus/third_party/pgf -I/home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/scribus/third_party/pgf -I/opt/qt5/include -I/opt/qt5/include/QtCore -I/opt/qt5/mkspecs/default -I/opt/qt5/include/QtWidgets -I/opt/qt5/include/QtGui -I/opt/qt5/include/QtXml -I/opt/qt5/include/QtWebKit -I/opt/qt5/include/QtOpenGL -I/opt/qt5/include/QtNetwork -I/usr/include/qt5 -I/usr/include/qt5/QtWebKitWidgets -I/usr/include/qt5/QtQuick -I/usr/include/qt5/QtQml -I/usr/include/qt5/QtPrintSupport -I/usr/include/qt5/QtLocation -I/usr/include/qt5/QtSensors -I/home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/builddir -I/home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/builddir/scribus -I/usr/include/libxml2 -I/home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810 -I/home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/scribus    -DSHAREDIR=\"/home/fabio/scribusinstall/share/scribus/\" -DDOCDIR=\"/home/fabio/scribusinstall/share/doc/scribus/\" -DICONDIR=\"/home/fabio/scribusinstall/share/scribus/icons/\" -DSAMPLESDIR=\"/home/fabio/scribusinstall/share/scribus/samples/\" -DSCRIPTSDIR=\"/home/fabio/scribusinstall/share/scribus/scripts/\" -DTEMPLATEDIR=\"/home/fabio/scribusinstall/share/scribus/templates/\" -DDESKTOPDIR=\"/home/fabio/scribusinstall/share/applications/\" -DLIBDIR=\"/home/fabio/scribusinstall/lib/scribus/\" -DPLUGINDIR=\"/home/fabio/scribusinstall/lib/scribus/plugins/\" -D -D -DCOMPILE_SCRIBUS_MAIN_APP -o CMakeFiles/scribus_pgf_lib.dir/Decoder.cpp.o -c /home/fabio/ScribusSVN/scribus-trunk-1.5.0svn201304091810/scribus/third_party/pgf/Decoder.cpp