Qt5.6 static がコンパイルできない

Debian GNU/Linux 8 (jessie) で、Qt5.6 SDK(スタティックリンク版)を作ろうとしています。

最初にXCB関係のパッケージをインストールしておきます。

apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-xinerama0-dev

qt-everywhere-opensource-src-5.6.0.tar.gz を展開してから、下記のようにconfigureします。

./configure -static -nomake examples -prefix /opt/Qt5.6.0-static

終わったらmakeします。同じ手順で、Qt5.5.1なら成功するのですが、Qt5.6.0だと次のようなエラーが出ます。

g++ -c -pipe -O2 -std=c++1y -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_XKB -DQT_QML_DEBUG_NO_WARNING -DQT_USE_QSTRINGBUILDER -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I../../include -I../../include/QtQml -I/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtbase/include -I/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtNetwork -I/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/5.6.0 -I/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/5.6.0/QtCore -I/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtWidgets -I/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtGui -I/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore -I.moc -I/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtbase/mkspecs/linux-g++ -o .obj/moc_conf.o .moc/moc_conf.cpp
g++ -Wl,--gc-sections -Wl,-O1 -fuse-ld=gold -Wl,--enable-new-dtags -o ../../bin/qml .obj/main.o .obj/qml_qml_plugin_import.o .obj/qml_plugin_import.o .obj/qrc_qml.o .obj/moc_conf.o   -L/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtdeclarative/lib -L/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtbase/lib -lQt5Widgets -L/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtdeclarative/plugins/qmltooling -lqmldbg_debugger -lqmldbg_local -lqmldbg_native -lqmldbg_profiler -lqmldbg_server -lqmldbg_tcp -lQt5Qml -L/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtbase/plugins/bearer -lqconnmanbearer -lqgenericbearer -lqnmbearer -lQt5Network -L/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtbase/plugins/platforms -lqxcb -lQt5XcbQpa -lX11 -lX11-xcb -lXi -lxcb-render-util -lxcb-render -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr -lxcb-shape -lxcb-keysyms -lxcb-xinerama -lQt5PlatformSupport -lfontconfig -lfreetype -lQt5DBus -L/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtimageformats/plugins/imageformats -lqdds -lqicns -lqtga -lqtiff -lqwbmp -lqwebp -L/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtbase/plugins/imageformats -lqico -lQt5Gui -lpng -lqtharfbuzzng -lQt5Core -lz -lqtpcre -lm -ldl -lrt -lpthread
/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtdeclarative/lib/libQt5Qml.a(qqmldebugconnector.o):qqmldebugconnector.cpp:function _GLOBAL__sub_I_qqmldebugconnector.cpp: error: undefined reference to 'qt_static_plugin_QQmlInspectorServiceFactory()'
collect2: error: ld returned 1 exit status
Makefile:93: recipe for target '../../bin/qml' failed
make[3]: *** [../../bin/qml] Error 1
make[3]: Leaving directory '/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtdeclarative/tools/qml'
Makefile:96: recipe for target 'sub-qml-make_first' failed
make[2]: *** [sub-qml-make_first] Error 2
make[2]: Leaving directory '/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtdeclarative/tools'
Makefile:70: recipe for target 'sub-tools-make_first' failed
make[1]: *** [sub-tools-make_first] Error 2
make[1]: Leaving directory '/home/soramimi/a/qt-everywhere-opensource-src-5.6.0/qtdeclarative'
Makefile:324: recipe for target 'module-qtdeclarative-make_first' failed
make: *** [module-qtdeclarative-make_first] Error 2

qqmldebugconnector.cpp が参照している qt_static_plugin_QQmlInspectorServiceFactory() が定義されていない、ということのようですが、この対策方法はあるでしょうか?

カテゴリー: 未分類   パーマリンク

Qt5.6 static がコンパイルできない への3件のコメント

  1. Hello,

    I could solve this by using the git version of Qt5.6 to build, instead of the release packages.

    • soramimi より:

      Hi,
      I tried to compile according to your advice.
      It was completed very well.
      Thank you very much.

  2. soramimi より:

    アドバイスいただいた通りに、gitでソースコードを取ってきてmakeしたら、一度は成功したんだけど、別のマシン(VMware上の仮想マシン)で同じように、gitで取ってきたQt5.6をmakeすると、また同じエラーが出た。エラーになる場合とならない場合の条件の差が分からない。

    configureオプションに -no-qml-debug を付けたら成功したので、当分の間はこれを使うことにする。

    ref. http://forum.qt.io/topic/65629/qt-5-6-linux-compile-fails

Jean-Michaël Celerier にコメントする コメントをキャンセル

メールアドレスが公開されることはありません。

次のHTML タグと属性が使えます: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CAPTCHA(画像認証)

上の画像の最初と最後を除いた3桁の数字を入力して、送信ボタンを押してください。