忍者ブログ

素人翻訳

適当に翻訳する。

qt-5.1.1構築時のエラー

 qt-5.1.1を構築した時に出たエラーとその解決方法。使用したのは、qt-everywhere-opensource-src-5.1.1.tar.xz。

$ ./configure
...
...
Running configuration tests...
The test for linking against libxcb and support libraries failed!
You might need to install dependency packages, or pass -qt-xcb.
See src/plugins/platforms/xcb/README.
$

 libxcb系のライブラリは自作のものが入っていたのだが、とりあえず上手く行かなかった。

 qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/platforms/xcb/README によると、

...
...
REDUCING RUNTIME DEPENDENCIES

The '-qt-xcb' configure option can be used to get rid of most xcb- dependencies. Only libxcb will
still be linked dynamically, since it will be most likely be pulled in via other dependencies anyway.
This should allow for binaries that are portable across most modern Linux distributions.
(訳)
(「-qt-xcb」を指定すると、「xcb-〜〜」の依存問題から解放される。)
(その場合でも「libxcb」自体は必要。云々。)

 「./configure -qt-xcb」で片付けることにした。

$ ./configure -qt-xcb
...
...
$ make
...
...
g++ -c -include .pch/release-shared/Qt5Network -pipe -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_LIBUDEV -DQT_NO_USING_NAMESPACE -DQT_BUILD_NETWORK_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_CORE_LIB -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtNetwork -I../../include/QtNetwork/5.1.1 -I../../include/QtNetwork/5.1.1/QtNetwork -I../3rdparty/zlib -Ikernel -I../../include/QtCore -I../../include/QtCore/5.1.1 -I../../include/QtCore/5.1.1/QtCore -I.moc/release-shared -o .obj/release-shared/qsslcertificate.o ssl/qsslcertificate.cpp
ssl/qsslcertificate.cpp: In member function ‘QByteArray QSslCertificate::version() const’:
ssl/qsslcertificate.cpp:288: error: invalid use of incomplete type ‘struct x509_st’
/usr/local/include/openssl/ossl_typ.h:119: error: forward declaration of ‘struct x509_st’
ssl/qsslcertificate.cpp: In member function ‘QByteArray QSslCertificate::serialNumber() const’:
ssl/qsslcertificate.cpp:300: error: invalid use of incomplete type ‘struct x509_st’
/usr/local/include/openssl/ossl_typ.h:119: error: forward declaration of ‘struct x509_st’
ssl/qsslcertificate.cpp: In member function ‘QSslKey QSslCertificate::publicKey() const’:
ssl/qsslcertificate.cpp:562: error: invalid use of incomplete type ‘struct x509_st’
/usr/local/include/openssl/ossl_typ.h:119: error: forward declaration of ‘struct x509_st’
ssl/qsslcertificate.cpp:566: error: invalid use of incomplete type ‘struct evp_pkey_st’
/usr/local/include/openssl/ossl_typ.h:93: error: forward declaration of ‘struct evp_pkey_st’
ssl/qsslcertificate.cpp:570: error: invalid use of incomplete type ‘struct evp_pkey_st’
/usr/local/include/openssl/ossl_typ.h:93: error: forward declaration of ‘struct evp_pkey_st’
ssl/qsslcertificate.cpp:574: error: invalid use of incomplete type ‘struct evp_pkey_st’
/usr/local/include/openssl/ossl_typ.h:93: error: forward declaration of ‘struct evp_pkey_st’
make[3]: *** [.obj/release-shared/qsslcertificate.o] エラー 1
make[3]: ディレクトリ `/home/user12/qt/qt-everywhere-opensource-src-5.1.1/qtbase/src/network' から出ます
make[2]: *** [sub-network-make_first] エラー 2
make[2]: ディレクトリ `/home/user12/qt/qt-everywhere-opensource-src-5.1.1/qtbase/src' から出ます
make[1]: *** [sub-src-make_first] エラー 2
make[1]: ディレクトリ `/home/user12/qt/qt-everywhere-opensource-src-5.1.1/qtbase' から出ます
make: *** [module-qtbase-make_first] エラー 2
$

 SSL関係のエラーが出た。調べてみると、openssl は「1.0」と「1.1」で ABI が変わっているらしく、qt-5.1.1 では古い方の openssl が必要だとか。SSLは不要なので、
「./configure -qt-xcb -no-openssl」で解決。

$ ./configure -qt-xcb -no-openssl
...
...
$ make
...
...
...
g++ -Wl,-O1 -Wl,-rpath,/usr/local/Qt-5.1.1/lib -o styles .obj/release-shared/main.o .obj/release-shared/norwegianwoodstyle.o .obj/release-shared/widgetgallery.o .obj/release-shared/qrc_styles.o .obj/release-shared/moc_norwegianwoodstyle.o .obj/release-shared/moc_widgetgallery.o -L/home/user12/SourceCode/qt-everywhere-opensource-src-5.1.1/qtbase/lib -lQt5Widgets -lQt5Gui -lQt5Core -lpthread
make[5]: ディレクトリ `/home/user12/SourceCode/qt-everywhere-opensource-src-5.1.1/qtbase/examples/widgets/widgets/styles' から出ます
make[4]: ディレクトリ `/home/user12/SourceCode/qt-everywhere-opensource-src-5.1.1/qtbase/examples/widgets/widgets' から出ます
cd windowcontainer/ && ( test -e Makefile || /home/user12/SourceCode/qt-everywhere-opensource-src-5.1.1/qtbase/bin/qmake /home/user12/SourceCode/qt-everywhere-opensource-src-5.1.1/qtbase/examples/widgets/windowcontainer/windowcontainer.pro -o Makefile ) && make -f Makefile
make[4]: ディレクトリ `/home/user12/SourceCode/qt-everywhere-opensource-src-5.1.1/qtbase/examples/widgets/windowcontainer' に入ります
/home/user12/SourceCode/qt-everywhere-opensource-src-5.1.1/qtbase/bin/moc -DQT_NO_LIBUDEV -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../mkspecs/linux-g++ -I. -I../../gui/openglwindow -I../../../include -I../../../include/QtWidgets -I../../../include/QtGui -I../../../include/QtCore -I.moc/release-shared -I/usr/lib/gcc/x86_64-vine-linux/4.4.5/../../../../include/c++/4.4.5 -I/usr/lib/gcc/x86_64-vine-linux/4.4.5/../../../../include/c++/4.4.5/x86_64-vine-linux -I/usr/lib/gcc/x86_64-vine-linux/4.4.5/../../../../include/c++/4.4.5/backward -I/usr/local/include -I/usr/lib/gcc/x86_64-vine-linux/4.4.5/include -I/usr/include windowcontainer.cpp -o .moc/release-shared/windowcontainer.moc
g++ -c -pipe -O2 -fno-exceptions -Wall -W -D_REENTRANT -fPIE -DQT_NO_LIBUDEV -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../mkspecs/linux-g++ -I. -I../../gui/openglwindow -I../../../include -I../../../include/QtWidgets -I../../../include/QtGui -I../../../include/QtCore -I.moc/release-shared -o .obj/release-shared/windowcontainer.o windowcontainer.cpp
In file included from windowcontainer.cpp:41:
../../gui/openglwindow/openglwindow.h:52: error: expected class-name before ‘{’ token
make[4]: *** [.obj/release-shared/windowcontainer.o] エラー 1
make[4]: ディレクトリ `/home/user12/SourceCode/qt-everywhere-opensource-src-5.1.1/qtbase/examples/widgets/windowcontainer' から出ます
make[3]: *** [sub-windowcontainer-make_first] エラー 2
make[3]: ディレクトリ `/home/user12/SourceCode/qt-everywhere-opensource-src-5.1.1/qtbase/examples/widgets' から出ます
make[2]: *** [sub-widgets-make_first] エラー 2
make[2]: ディレクトリ `/home/user12/SourceCode/qt-everywhere-opensource-src-5.1.1/qtbase/examples' から出ます
make[1]: *** [sub-examples-make_first] エラー 2
make[1]: ディレクトリ `/home/user12/SourceCode/qt-everywhere-opensource-src-5.1.1/qtbase' から出ます
make: *** [module-qtbase-make_first] エラー 2
$

 OpenGL関連のエラー。PKG_CONFIG_PATH等を確認し、
「./configure -qt-xcb -no-openssl -no-opengl」を試しても同じエラーが出た。

 エラーをよく見てみると、
「/home/user12/SourceCode/qt-everywhere-opensource-src-5.1.1/qtbase/examples/widgets/~~」
とあり、OpenGLを使用するサンプル・プログラムの構築で失敗している。「-no-opengl」を指定しても、勝手に作ってしまうようだ。

 サンプルは要らないので、
「./configure -qt-xcb -no-openssl -no-opengl -no-compile-examples
で解決。これでmake、sudo make install ともに成功。

 英語のサイトを見ていると、「なぜ古いQtをコンパイルするのか」「どうして自分で作ろうとするのか」といった書き込みがチラホラあった。

PR

コメント

お名前
タイトル
文字色
メールアドレス
URL
コメント
パスワード Vodafone絵文字 i-mode絵文字 Ezweb絵文字

カレンダー

03 2024/04 05
S M T W T F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

最新コメント

[08/18 NONAME]
[05/18 NONAME]
[04/09 NONAME]
[03/21 NONAME]
[03/20 NONAME]

最新記事

ブログ内検索

広告

バーコード

広告