Qt单个模块的编译

有可能使用的Qt没有自己需要的模块,这个时候就只能自己去编译这个模。
本次就拿QWebEngine这个模块来讲,这个模块比较复杂,编译很容易出问题。

1、进入 qt-everywhere-opensource-src-5.9.2/qtwebengine/文件夹
执行 qmake qtwebengine.pro
这一步基本上都会报错,报一些库的缺失。
使用 ldconfig -p | grep ***可以查找库
把对应的库安装好

再次执行 qmake qtwebengine.pro
报错:
Unmet dependency : dbus-1
Unmet dependency : xtst
然后安装
apt-get install libdbus-1-dev
apt-get install libxtst-dev
然后 make
会出现类似错误:
ACTION //third_party/blink/renderer/core:make_core_generated_bison(//build/toolchain/linux:clang_x64)
FAILED: gen/third_party/blink/renderer/core/xpath_grammar.cc gen/third_party/blink/renderer/core/xpath_grammar.h 
python ../../third_party/blink/renderer/build/scripts/rule_bison.py ../../third_party/blink/renderer/core/xml/xpath_grammar.y gen/third_party/blink/renderer/core bison
Traceback (most recent call last):
  File "../../third_party/blink/renderer/build/scripts/rule_bison.py", line 83, in 
    returnCode = subprocess.call([bisonExe, '-d', '-p', prefix, inputFile, '-o', outputCpp])
  File "/usr/lib/python2.7/subprocess.py", line 172, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
[4431/35533] ACTION //third_party/angle/third_party/vulkan-valida...unique_objects_wrappers_helper(//build/toolchain/linux:clang_x64)
ninja: build stopped: subcommand failed.

安装:
apt-get install flex
apt-get install bison

make
这次不出意外就需要很长时间,然后 make install 就可以在creater里面看到了

你可能感兴趣的:(Qt实战遇到的问题总结)