Problems with compiling QT and Qvfb in Ubuntu9.04

Source: Internet
Author: User
Problem solving when compiling QT and Qvfb in Ubuntu9.04: 1./usr/bin/ld: cannotfind-lXtst is a problem with the Library name. so.6 and other numbers, but such library names cannot be identified during qt compilation, the solution is to establish a soft connection with the largest library names without digits, such: sudoln-s/usr/lib/libXtst. so.6/usr/lib/libXtst. so, then ok2, cannot find

Solutions to problems with compiling QT and Qvfb in Ubuntu 9.04:

1./usr/bin/ld: cannot find-lXtst. This problem is caused by the Library name. so.6 and other numbers, but such library names cannot be identified during qt compilation, the solution is to establish a soft connection with the largest library names without digits
For example: sudo ln-s/usr/lib/libXtst. so.6/usr/lib/libXtst. so, and then OK

2. If XTest. h and XInput. h cannot be found, two packages must be installed:

XTest. h ---- libext-dev
XInput. h --- libxi-dev

3. Problems with qvfb Compilation

Make sure to use qmake
Reprinted, like the problem he encountered, the solution is to refer to his
After the translation, I try the following steps !!)

1. Go to the qvfb source code directory:
# Cd/home/src/qt-x11-opensource-src-4.4.3/tools/qvfb
2. Execute qmake to generate the pro project:
#/Home/src/qt-x11-opensource-src-4.4.3/bin/qmake-project
3. Execute qmake to generate Makefile
# // Home/src/qt-x11-opensource-src-4.4.3/bin/qmake
4. Compile make
# Make

Error:
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: Error: deviceskin. h: No file or directory
Qvfb. cpp: In member function 'void QVFb: init (int, const QString &)':
Qvfb. cpp: 247: Warning: problems that may occur when calling the delete operator are detected:
Qvfb. cpp: 247: Warning: invalid use of undefined type 'struct DeviceSkin'
Qvfb. h: 53: Warning: forward declaration of 'struct DeviceSkin'
Qvfb. cpp: 247: Note: destructor and delete operators of the class are not called, even if they are declared during class definition.
Qvfb. cpp: 257: Error: 'deviceskinparameters 'has not been declared in this scope
Qvfb. cpp: 257: Error: expected '; ''before 'parameters'
Qvfb. cpp: 259: Error: 'parameters 'has not been declared in this scope
Qvfb. cpp: 259: Error: 'deviceskinparameters 'is not a class or namespace
Qvfb. cpp: 260: Error: invalid use of undefined type 'struct DeviceSkin'
Qvfb. h: 53: Error: forward declaration of 'struct DeviceSkin'
Qvfb. cpp: 261: error: the call to 'qvfb: connect (DeviceSkin * &, const char [13], QVFb * const, const char [13]) 'does not have a matched function.
.. /.. /Include/QtCore /.. /.. /src/corelib/kernel/qobject. h: 197: Note: Alternative: static bool QObject: connect (const QObject *, const char *, const QObject *, const char *, Qt: ConnectionType)
.. /.. /Include/QtCore /.. /.. /src/corelib/kernel/qobject. h: 302: Note: bool QObject: connect (const QObject *, const char *, const char *, Qt: ConnectionType) const
Qvfb. cpp: 277: Error: 'qvfbx11view: QVFbX11View (int &, int &, qvfb1_actview: Rotation &, DeviceSkin *&) 'No matching function is called.
Qvfbx11view. h: 52: Note: Option 1: QVFbX11View: QVFbX11View (int, qvfb1_actview: Rotation, QWidget *)
Qvfbx11view. h: 49: Note: QVFbX11View: QVFbX11View (const QVFbX11View &)
Qvfb. cpp: 280: Error: 'qvfbview: QVFbView (int &, int &, qvfb1_actview: Rotation &, DeviceSkin *&) 'No matching function is called.
Qvfbview. h: 109: Note: Option: QVFbView (int, qvfb1_actview: Rotation, QWidget *)
Qvfbview. h: 106: Note: QVFbView (const QVFbView &)
Qvfb. cpp: 281: Error: invalid use of undefined type 'struct DeviceSkin'
Qvfb. h: 53: Error: forward declaration of 'struct DeviceSkin'
Qvfb. cpp: 284: error: the call to 'qvfb: connect (DeviceSkin * &, const char [37], qvfb1_actview * &, const char [37]) 'does not have a matched function.
.. /.. /Include/QtCore /.. /.. /src/corelib/kernel/qobject. h: 197: Note: Alternative: static bool QObject: connect (const QObject *, const char *, const QObject *, const char *, Qt: ConnectionType)
.. /.. /Include/QtCore /.. /.. /src/corelib/kernel/qobject. h: 302: Note: bool QObject: connect (const QObject *, const char *, const char *, Qt: ConnectionType) const
Qvfb. cpp: 285: error: the call to 'qvfb: connect (DeviceSkin * &, const char [39], qvfb1_actview * &, const char [39]) 'does not have a matched function.
.. /.. /Include/QtCore /.. /.. /src/corelib/kernel/qobject. h: 197: Note: Alternative: static bool QObject: connect (const QObject *, const char *, const QObject *, const char *, Qt: ConnectionType)
.. /.. /Include/QtCore /.. /.. /src/corelib/kernel/qobject. h: 302: Note: bool QObject: connect (const QObject *, const char *, const char *, Qt: ConnectionType) const
Qvfb. cpp: 287: Error: invalid use of undefined type 'struct DeviceSkin'
Qvfb. h: 53: Error: forward declaration of 'struct DeviceSkin'
Qvfb. cpp: 289: error: the call to 'qvfb: setCentralWidget (DeviceSkin * &) 'does not have a matched function.
.. /.. /Include/QtGui /.. /.. /src/gui/widgets/qmainwindow. h: 116: Note: Option: void QMainWindow: setCentralWidget (QWidget *)
Qvfb. cpp: 302: error: the call to 'qvfbx11view: QVFbX11View (int, int &, qvfb1_actview: Rotation &, DeviceSkin * &) 'has no matching function.
Qvfbx11view. h: 52: Note: Option 1: QVFbX11View: QVFbX11View (int, qvfb1_actview: Rotation, QWidget *)
Qvfbx11view. h: 49: Note: QVFbX11View: QVFbX11View (const QVFbX11View &)
Qvfb. cpp: 305: error: the call to 'qvfbview: QVFbView (int, int &, qvfb1_actview: Rotation &, DeviceSkin * &) 'does not have a matched function.
Qvfbview. h: 109: Note: Option: QVFbView (int, qvfb1_actview: Rotation, QWidget *)
Qvfbview. h: 106: Note: QVFbView (const QVFbView &)
Qvfb. cpp: 306: Error: invalid use of undefined type 'struct DeviceSkin'
Qvfb. h: 53: Error: forward declaration of 'struct DeviceSkin'
Qvfb. cpp: In member function 'void QVFb: enableCursor (bool )':
Qvfb. cpp: 379: Error: invalid use of undefined type 'struct DeviceSkin'
Qvfb. h: 53: Error: forward declaration of 'struct DeviceSkin'
Qvfb. cpp: In member function 'void QVFb: setZoom (double )':
Qvfb. cpp: 453: Error: invalid use of undefined type 'struct DeviceSkin'
Qvfb. h: 53: Error: forward declaration of 'struct DeviceSkin'
Qvfb. cpp: In member function 'void QVFb: skinConfigChosen (int )':
Qvfb. cpp: 771: Error: 'deviceskinparameters 'has not been declared in this scope
Qvfb. cpp: 771: Error: expected '; ''before 'parameters'
Qvfb. cpp: 773: Error: 'parameters 'has not been declared in this scope
Qvfb. cpp: 773: Error: 'deviceskinparameters 'is not a class or namespace
Make: *** [. obj/release-shared/qvfb. o] Error 1
Almost gave up. Later, I carefully checked the compilation error. It is estimated that it is mainly a bad head file:
Qvfb. cpp: 47: 24: Error: deviceskin. h: No file or directory
Generally, the difference header file will cause many data structures and constants in the cpp file to be not defined. Find the header file deviceskin. h under the qt-x11-opensource-src-4.4.3/tools/shared/deviceskin. Copy to the qvfb folder. Re-compile:

There is no problem with compilation. Connection error:

. Obj/release-shared/qvfb. o: In function 'qvfb: setZoom (double )'':
/Home/src/qt-x11-opensource-src-4.4.3/tools/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. 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. cpp: 773: undefined reference to 'deviceskinparameters: read (QString const &, DeviceSkinParameters: ReadMode, QString *)''
. Obj/release-shared/qvfb. o: In function 'qvfb: init (int, int, QString const &)'':
/Home/src/qt-x11-opensource-src-4.4.3/tools/qvfb. cpp: 259: undefined reference to 'deviceskinparameters: read (QString const &, DeviceSkinParameters: ReadMode, QString *)''
/Home/src/qt-x11-opensource-src-4.4.3/tools/qvfb. cpp: 260: undefined reference to 'deviceskin: DeviceSkin (DeviceSkinParameters const &, QWidget *)''
/Home/src/qt-x11-opensource-src-4.4.3/tools/qvfb. cpp: 281: undefined reference to 'deviceskin: setView (QWidget *)''
/Home/src/qt-x11-opensource-src-4.4.3/tools/qvfb. cpp: 297: undefined reference to 'deviceskinparameters: hasSecondaryScreen () const''
/Home/src/qt-x11-opensource-src-4.4.3/tools/qvfb. cpp: 298: undefined reference to 'deviceskinparameters: secondaryScreenSize () const''
/Home/src/qt-x11-opensource-src-4.4.3/tools/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 returns 1
Make: *** [qvfb] Error 1

There are two possible errors: one is the function connection of the DeviceSkinParameters class and the other is the XTestFakeKeyEvent function.
Solution:

Copy the qt-x11-opensource-src-4.4.3/tools/shared/deviceskin. h, deviceskin. cpp to the qvfb folder, regenerate the pro project, Makefile file, and then execute make.
In this case, the function connection problem of the DeviceSkinParameters class is solved. The XTestFakeKeyEvent function connection problem persists.

Finally, add the-lXtst option to LIBS in the Makefile file .. Make again. OK !!
The generated qvfb runs correctly.

The solution is as follows:

1. Copy deviceskin. h and deviceskin. cpp to the qvfb file.
2. Manually generate the qvfb project in the qvfb folder.
3. Modify the LIBS option in Makefile: add the-lXtst option.
Compile...

Note that you need to regenerate the project file to copy deviceskin. h and deviceskin. cpp to the qvfb file.
Qmake-project
Finally, we got it done.
I learned a lot of things. I learned some things I learned a few days ago, and I got a good workout...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.