2014-11-02 289 views
1

我想編譯PhantomJS 2,它使用Qt5。我遇到這種故障:Qt5構建失敗

make[2]: Entering directory `/app/phantomjs/src/qt/qtbase/src/platformsupport' 
g++ -c -include .pch/Qt5PlatformSupport -pipe -O2 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_NO_GRAPHICSVIEW -DQT_NO_GRAPHICSEFFECT -DQT_NO_STYLESHEET -DQT_NO_STYLE_CDE -DQT_NO_STYLE_CLEANLOOKS -DQT_NO_STYLE_MOTIF -DQT_NO_STYLE_PLASTIQUE -DQT_NO_CAST_FROM_ASCII -DQT_NO_FONTCONFIG -DQT_BUILD_PLATFORMSUPPORT_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtPlatformSupport -I../../include/QtPlatformSupport/5.3.0 -I../../include/QtPlatformSupport/5.3.0/QtPlatformSupport -I../../include/QtGui/5.3.0 -I../../include/QtGui/5.3.0/QtGui -I../../include/QtGui -I../../include/QtCore/5.3.0 -I../../include/QtCore/5.3.0/QtCore -I../../include/QtCore -I.moc -o .obj/qbasicfontdatabase.o fontdatabases/basic/qbasicfontdatabase.cpp 
In file included from ../../include/QtGui/5.3.0/QtGui/private/../../../../../src/gui/text/qfontengine_ft_p.h:58:0, 
       from ../../include/QtGui/5.3.0/QtGui/private/qfontengine_ft_p.h:1, 
       from fontdatabases/basic/qbasicfontdatabase.cpp:54: 
/usr/include/ft2build.h:56:38: fatal error: freetype/config/ftheader.h: No such file or directory 
#include <freetype/config/ftheader.h> 
            ^
compilation terminated. 
make[2]: *** [.obj/qbasicfontdatabase.o] Error 1 
make[2]: Leaving directory `/app/phantomjs/src/qt/qtbase/src/platformsupport' 
make[1]: *** [sub-platformsupport-make_first] Error 2 
make[1]: Leaving directory `/app/phantomjs/src/qt/qtbase/src' 
make: *** [sub-src-make_first] Error 2 

我已經安裝了對FreeType2:

$ find/-name ftheader.h 
/usr/include/freetype2/freetype/config/ftheader.h 
/app/phantomjs/src/qt/qtbase/src/3rdparty/freetype/include/freetype/config/ftheader.h 

不知道如何解決這個問題,因爲我沒有使用C/C++構建了豐富的經驗。我可能不得不添加/更改前綴,但我不知道如何。

+0

我在https://github.com/ariya/phantomjs/建立主;你看到有一個'build.sh'這是我正在使用的。不通過任何選項。我必須安裝一些庫才能響應故障。但是,如上所述,安裝freetype2-devel頭文件並沒有幫助。 – 2014-11-02 22:49:09

+0

是否包含正確的路徑?也許不是? – lpapp 2014-11-03 07:50:19

回答

3

如果你看一下錯誤()的位置,有正上方的評論:

55 /* `<prefix>/include/freetype2' must be in your current inclusion path */                                        
56 #include <freetype/config/ftheader.h> 

不知道爲什麼編譯沒有解決這個對自己,因爲它解決的其他它依賴的庫,但添加-I /usr/include/freetype2到構建配置的伎倆。

對於PhantomJS的具體的情況下,完整的命令是:

./build.sh --confirm --qt-config '-I /usr/include/freetype2'