Qcad 2.2.1 pro link problem: libQtGui.a

Post your question about installing or upgrading to QCAD 2.1/2.2. Be sure to search, and check the docs before you post!

Moderator: andrew

Locked
ckomurlu
Junior Member
Posts: 11
Joined: Thu May 07, 2009 12:27 pm

Qcad 2.2.1 pro link problem: libQtGui.a

Post by ckomurlu » Thu Jun 04, 2009 4:58 pm

Hi,
I try to build Qcad 2.2.1 pro on Ubuntu 9.04 with Qt4.4.3 built statically. All modules of Qcad were built except qcad. The compilation of qcad module went alright but I got stuck at linking with the error below:

Code: Select all

/home/bilko/workbench/qt-all-opensource-src-4.4.3//lib/libQtGui.a(qapplication_x
11.o): In function `qt_wstate_iconified(unsigned long)':
qapplication_x11.cpp:(.text+0x76b): undefined reference to `XGetWindowProperty'
qapplication_x11.cpp:(.text+0x79c): undefined reference to `XFree'
/home/bilko/workbench/qt-all-opensource-src-4.4.3//lib/libQtGui.a(qapplication_x
11.o): In function `_ZL20qt_check_focus_modelv':
qapplication_x11.cpp:(.text+0x8e4): undefined reference to `XGetInputFocus'
/home/bilko/workbench/qt-all-opensource-src-4.4.3//lib/libQtGui.a(qapplication_x
11.o): In function `_ZL20qt_get_net_supportedv':
qapplication_x11.cpp:(.text+0xa0d): undefined reference to `XGetWindowProperty'
qapplication_x11.cpp:(.text+0xa1e): undefined reference to `XFree'
qapplication_x11.cpp:(.text+0xb0f): undefined reference to `XGetWindowProperty'
qapplication_x11.cpp:(.text+0xb33): undefined reference to `XFree'

and so on
I installed dev packages of X11 using Synaptic. Not only qapplication_x11.cpp but also other .cpp files throw such errors at this linking stage. I cheked the files in qt4.4.3/src/gui/kernel, there the files are. What can be the cause, any solution suggestion?

I can also post the whole error report.

Thanks a lot.
Best regards,
Caner Kömürlü
R&D Office
Bilko Co.

ckomurlu
Junior Member
Posts: 11
Joined: Thu May 07, 2009 12:27 pm

Post by ckomurlu » Fri Jun 05, 2009 1:05 pm

Hello,
In this problem, qcad cannot reach X11 lib at linking. Hence in Makefile, adding -lX11 option to the lib list is enough to solve X11 related problems. Then, a second undefined reference problem occurs. The error report is:

Code: Select all

In function `QTimerInfoList::getTime(timeval&)':
qeventdispatcher_unix.cpp:(.text+0x8c7): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
make: *** [qcad] Error 1
To solve it, again I added a lib into list: -lrt

Briefly, adding parameters -lX11 and -lrt to LIBS variable solves these link problems. Note that, it's a kind of workaround, since the Makefile is automatically generated using .pro file and qmake command. The exact solution is supposed to be related to .pro file, not to Makefile.

Regards
Caner Kömürlü
R&D Office
Bilko Co.

Locked

Return to “QCAD 2.1/2.2 Installation and Upgrades”