2014-11-02 294 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'