Qt5构建失败

时间:2014-11-02 22:46:03

标签: c++ qt build

我正在尝试编译使用Qt5的PhantomJS 2。我遇到了这个失败:

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 ++构建经验。我可能需要添加/更改前缀,但我不确定如何。

1 个答案:

答案 0 :(得分: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'