国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項超值服

開通VIP
編譯qt及qvfb遇到的問題
編譯qt及qvfb遇到的問題(2009-07-19 00:03:32)
標(biāo)簽:雜談      分類:個人心得
1、/usr/bin/ld: cannot find -lXtst這個問題是庫名稱的問題,一般庫后都有.so.6等數(shù)字,而qt編譯時,這樣的庫名識別不了,解決辦法是建立一個不帶數(shù)字后最的庫名的軟連接
如這個問題:sudo ln -s /usr/lib/libXtst.so.6 /usr/lib/libXtst.so,然后ok

2、找不到XTest.h和XInput.h 要裝兩個包:
XTest.h----libext-dev
XInput.h ---libxi-dev


3、編譯qvfb遇到的問題

一定要用qmake

轉(zhuǎn)載,和他遇到的問題一樣,解決方法就是參照他的

譯結(jié)束后我嘗試的步驟如下: (著急的直接看最后幾行!!)
1.進(jìn)入qvfb源碼目錄:
# cd /home/src/qt-x11-opensource-src-4.4.3/tools/qvfb
2.執(zhí)行qmake生成pro工程:
# /home/src/qt-x11-opensource-src-4.4.3/bin/qmake -project
3.執(zhí)行qmake生成Makefile
# /home/src/qt-x11-opensource-src-4.4.3/bin/qmake
4.編譯make
# make

有錯誤:
g++ -c -pipe -g -O2 -Wall -W -D_REENTRANT -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include/QtCore -I../../include/QtGui -I../../include/QtGui -I../../include -I. -I.moc/release-shared -I.uic/release-shared -o .obj/release-shared/qvfb.o qvfb.cpp
qvfb.cpp:47:24: 錯誤:deviceskin.h:沒有那個文件或目錄
qvfb.cpp: In member function ‘void QVFb::init(int, int, int, int, int, const QString&)’:
qvfb.cpp:247: 警告:檢測到調(diào)用 delete 運(yùn)算符時可能出現(xiàn)的問題:
qvfb.cpp:247: 警告:invalid use of undefined type ‘struct DeviceSkin’
qvfb.h:53: 警告:forward declaration of ‘struct DeviceSkin’
qvfb.cpp:247: 附注:析構(gòu)函數(shù)和類特定的 delete 運(yùn)算符均不會被調(diào)用,即使它們在類定義時已經(jīng)聲明。
qvfb.cpp:257: 錯誤:‘DeviceSkinParameters’ 在此作用域中尚未聲明
qvfb.cpp:257: 錯誤:expected `;'' before ‘parameters’
qvfb.cpp:259: 錯誤:‘parameters’ 在此作用域中尚未聲明
qvfb.cpp:259: 錯誤:‘DeviceSkinParameters’ is not a class or namespace
qvfb.cpp:260: 錯誤:invalid use of undefined type ‘struct DeviceSkin’
qvfb.h:53: 錯誤:forward declaration of ‘struct DeviceSkin’
qvfb.cpp:261: 錯誤:對 ‘QVFb::connect(DeviceSkin*&, const char [13], QVFb* const, const char [13])’ 的調(diào)用沒有匹配的函數(shù)
../../include/QtCore/../../src/corelib/kernel/qobject.h:197: 附注:備選為: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
../../include/QtCore/../../src/corelib/kernel/qobject.h:302: 附注:         bool QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
qvfb.cpp:277: 錯誤:對 ‘QVFbX11View::QVFbX11View(int&, int&, int&, int&, QVFbAbstractView::Rotation&, DeviceSkin*&)’ 的調(diào)用沒有匹配的函數(shù)
qvfbx11view.h:52: 附注:備選為: QVFbX11View::QVFbX11View(int, int, int, int, QVFbAbstractView::Rotation, QWidget*)
qvfbx11view.h:49: 附注:         QVFbX11View::QVFbX11View(const QVFbX11View&)
qvfb.cpp:280: 錯誤:對 ‘QVFbView::QVFbView(int&, int&, int&, int&, QVFbAbstractView::Rotation&, DeviceSkin*&)’ 的調(diào)用沒有匹配的函數(shù)
qvfbview.h:109: 附注:備選為: QVFbView::QVFbView(int, int, int, int, QVFbAbstractView::Rotation, QWidget*)
qvfbview.h:106: 附注:         QVFbView::QVFbView(const QVFbView&)
qvfb.cpp:281: 錯誤:invalid use of undefined type ‘struct DeviceSkin’
qvfb.h:53: 錯誤:forward declaration of ‘struct DeviceSkin’
qvfb.cpp:284: 錯誤:對 ‘QVFb::connect(DeviceSkin*&, const char [37], QVFbAbstractView*&, const char [37])’ 的調(diào)用沒有匹配的函數(shù)
../../include/QtCore/../../src/corelib/kernel/qobject.h:197: 附注:備選為: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
../../include/QtCore/../../src/corelib/kernel/qobject.h:302: 附注:         bool QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
qvfb.cpp:285: 錯誤:對 ‘QVFb::connect(DeviceSkin*&, const char [39], QVFbAbstractView*&, const char [39])’ 的調(diào)用沒有匹配的函數(shù)
../../include/QtCore/../../src/corelib/kernel/qobject.h:197: 附注:備選為: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
../../include/QtCore/../../src/corelib/kernel/qobject.h:302: 附注:         bool QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
qvfb.cpp:287: 錯誤:invalid use of undefined type ‘struct DeviceSkin’
qvfb.h:53: 錯誤:forward declaration of ‘struct DeviceSkin’
qvfb.cpp:289: 錯誤:對 ‘QVFb::setCentralWidget(DeviceSkin*&)’ 的調(diào)用沒有匹配的函數(shù)
../../include/QtGui/../../src/gui/widgets/qmainwindow.h:116: 附注:備選為: void QMainWindow::setCentralWidget(QWidget*)
qvfb.cpp:302: 錯誤:對 ‘QVFbX11View::QVFbX11View(int, int, int, int&, QVFbAbstractView::Rotation&, DeviceSkin*&)’ 的調(diào)用沒有匹配的函數(shù)
qvfbx11view.h:52: 附注:備選為: QVFbX11View::QVFbX11View(int, int, int, int, QVFbAbstractView::Rotation, QWidget*)
qvfbx11view.h:49: 附注:         QVFbX11View::QVFbX11View(const QVFbX11View&)
qvfb.cpp:305: 錯誤:對 ‘QVFbView::QVFbView(int, int, int, int&, QVFbAbstractView::Rotation&, DeviceSkin*&)’ 的調(diào)用沒有匹配的函數(shù)
qvfbview.h:109: 附注:備選為: QVFbView::QVFbView(int, int, int, int, QVFbAbstractView::Rotation, QWidget*)
qvfbview.h:106: 附注:         QVFbView::QVFbView(const QVFbView&)
qvfb.cpp:306: 錯誤:invalid use of undefined type ‘struct DeviceSkin’
qvfb.h:53: 錯誤:forward declaration of ‘struct DeviceSkin’
qvfb.cpp: In member function ‘void QVFb::enableCursor(bool)’:
qvfb.cpp:379: 錯誤:invalid use of undefined type ‘struct DeviceSkin’
qvfb.h:53: 錯誤:forward declaration of ‘struct DeviceSkin’
qvfb.cpp: In member function ‘void QVFb::setZoom(double)’:
qvfb.cpp:453: 錯誤:invalid use of undefined type ‘struct DeviceSkin’
qvfb.h:53: 錯誤:forward declaration of ‘struct DeviceSkin’
qvfb.cpp: In member function ‘void QVFb::skinConfigChosen(int)’:
qvfb.cpp:771: 錯誤:‘DeviceSkinParameters’ 在此作用域中尚未聲明
qvfb.cpp:771: 錯誤:expected `;'' before ‘parameters’
qvfb.cpp:773: 錯誤:‘parameters’ 在此作用域中尚未聲明
qvfb.cpp:773: 錯誤:‘DeviceSkinParameters’ is not a class or namespace
make: *** [.obj/release-shared/qvfb.o] 錯誤 1

差點就放棄了。后來仔細(xì)看了一下編譯錯誤。估計主要是差個頭文件:
qvfb.cpp:47:24: 錯誤:deviceskin.h:沒有那個文件或目錄

一般差頭文件會導(dǎo)致cpp文件中很多數(shù)據(jù)結(jié)構(gòu)和常量沒有定義。找到頭文件deviceskin.h在qt-x11-opensource-src-4.4.3/tools/shared/deviceskin/下面??截惖絨vfb文件夾下。再編譯:

編譯沒有問題,連接出錯:

.obj/release-shared/qvfb.o: In function `QVFb::setZoom(double)'':
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/qvfb.cpp:453: undefined reference to `DeviceSkin::setTransform(QMatrix const&)''
.obj/release-shared/qvfb.o: In function `QVFb::enableCursor(bool)'':
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/qvfb.cpp:379: undefined reference to `DeviceSkin::hasCursor() const''
.obj/release-shared/qvfb.o: In function `QVFb::skinConfigChosen(int)'':
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/qvfb.cpp:773: undefined reference to `DeviceSkinParameters::read(QString const&, DeviceSkinParameters::ReadMode, QString*)''
.obj/release-shared/qvfb.o: In function `QVFb::init(int, int, int, int, int, QString const&)'':
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/qvfb.cpp:259: undefined reference to `DeviceSkinParameters::read(QString const&, DeviceSkinParameters::ReadMode, QString*)''
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/qvfb.cpp:260: undefined reference to `DeviceSkin::DeviceSkin(DeviceSkinParameters const&, QWidget*)''
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/qvfb.cpp:281: undefined reference to `DeviceSkin::setView(QWidget*)''
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/qvfb.cpp:297: undefined reference to `DeviceSkinParameters::hasSecondaryScreen() const''
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/qvfb.cpp:298: undefined reference to `DeviceSkinParameters::secondaryScreenSize() const''
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/qvfb.cpp:306: undefined reference to `DeviceSkin::setSecondaryView(QWidget*)''
.obj/release-shared/x11keyfaker.o: In function `X11KeyFaker::sendKeyEvent(int, bool)'':
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/x11keyfaker.cpp:475: undefined reference to `XTestFakeKeyEvent''
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/x11keyfaker.cpp:459: undefined reference to `XTestFakeKeyEvent''
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/x11keyfaker.cpp:468: undefined reference to `XTestFakeKeyEvent''
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/x11keyfaker.cpp:454: undefined reference to `XTestFakeKeyEvent''
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/x11keyfaker.cpp:447: undefined reference to `XTestFakeKeyEvent''
.obj/release-shared/x11keyfaker.o:/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/x11keyfaker.cpp:459: more undefined references to `XTestFakeKeyEvent'' follow
.obj/release-shared/x11keyfaker.o: In function `X11KeyFaker::connect()'':
/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb/x11keyfaker.cpp:544: undefined reference to `XTestQueryExtension''
collect2: ld 返回 1
make: *** [qvfb] 錯誤 1

能看出來有兩個方面的錯誤,一個是DeviceSkinParameters類的函數(shù)連接,另一個XTestFakeKeyEvent函數(shù)的問題。

我嘗試的解決辦法:

將qt-x11-opensource-src-4.4.3/tools/shared/deviceskin/下deviceskin.h,deviceskin.cpp都拷到qvfb文件夾下面,重新生成pro工程、Makefile文件,再執(zhí)行make.

這下子DeviceSkinParameters類的函數(shù)連接的問題解決了。XTestFakeKeyEvent函數(shù)連接的問題依舊。

最后在參考http://www.linuxquestions.org/questions/programming-9/strange-header-problem-228356/

在Makefile文件中LIBS里面添加-lXtst選項。。 再次make。 OK!!

生成的qvfb正確運(yùn)行。。

總結(jié)起來解決辦法是:

1。復(fù)制deviceskin.h,deviceskin.cpp到qvfb文件下。

2。在qvfb文件夾下手動生成qvfb工程。

3。修改Makefile 中 LIBS 選項: 添加 -lXtst選項。

編譯。。。


這里要注意,把deviceskin.h,deviceskin.cpp復(fù)制到qvfb文件下要重新生成project文件
即用qmake -project


終于搞定了

學(xué)到了不少東西,前幾天學(xué)到的東西有學(xué)以致用,鍛煉了下,愉快。。。
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
Fedora12安裝qt-x11-4.5.2,qvfb,qt/e
QtCreator中編譯qvfb失敗的原因
Qt/Qte 4.7.2開發(fā)環(huán)境搭建及Micro2440的移植筆記
linux上qvfb的安裝及應(yīng)用
ubuntu10.10建立QT開發(fā)環(huán)境圖文詳解
Qt 4.6.0 嵌入式開發(fā)環(huán)境的搭建、移植
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服