gpt4 book ai didi

c++ - Qt5 构建失败

转载 作者:行者123 更新时间:2023-11-30 02:42:50 25 4
gpt4 key购买 nike

我正在尝试编译使用 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++ 构建经验。我可能必须添加/更改前缀,但我不确定如何操作。

最佳答案

如果您查看错误 () 的位置,它的正上方有以下注释:

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'

关于c++ - Qt5 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26705346/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com