Undefined References in the GCC Library

I am trying to build a statically linked version of my company's main application on Linux. The app is using Qt 5.3 and everything compiles just fine if I use the debug / dynamic-linking build with Qt. However, I am getting a lot of weird errors from .a

libraries in /usr/lib/x86_64-linux-gnu

when doing static build.

I have configured Qt 5.3.1 for static builds using the following commands while in the 5.3/Src/qtbase/

Qt download folder :

./configure -release -static -opensource -nomake tools -nomake examples --force-asserts -no-sql-sqlite -no-libjpeg -no-opengl -no-gif -qt-xcb -qpa xcb
make clean
make sub-src

      

Then I build the application with QMake and make using the following commands in the Emu project directory:

/path/to/qt-static/qmake -r -spec linux-g++ emu.pro
make clean
make

      

The last command make

throws the following errors during the last binding step:

/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libXi.a(XExtInt.o): In function `XInput_find_display':
(.text+0xf9): undefined reference to `XextFindDisplay'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libXi.a(XExtInt.o): In function `XInput_find_display':
(.text+0x111): undefined reference to `XextCreateExtension'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libXi.a(XExtInt.o): In function `XInput_find_display':
(.text+0x1eb): undefined reference to `XextAddDisplay'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libXi.a(XExtInt.o): In function `XInputClose':
(.text+0x154a): undefined reference to `XextRemoveDisplay'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libXi.a(XExtInt.o): In function `XInputClose':
(.text+0x1575): undefined reference to `XextDestroyExtension'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libXi.a(XExtInt.o): In function `_XiCheckExtInit':
(.text+0x16f1): undefined reference to `XMissingExtension'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libxcb.a(xcb_auth.o): In function `get_authptr':
(.text+0xd4): undefined reference to `XauGetBestAuthByAddr'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libxcb.a(xcb_auth.o): In function `_xcb_get_auth_info':
(.text+0x321): undefined reference to `XauDisposeAuth'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libxcb.a(xcb_auth.o): In function `_xcb_get_auth_info':
(.text+0x55e): undefined reference to `XdmcpWrap'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libxcb.a(xcb_auth.o): In function `_xcb_get_auth_info':
(.text+0x56e): undefined reference to `XauDisposeAuth'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libfontconfig.a(fcxml.o): In function `FcConfigMessage':
(.text+0x290): undefined reference to `XML_GetCurrentLineNumber'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libfontconfig.a(fcxml.o): In function `FcConfigMessage':
(.text+0x301): undefined reference to `XML_GetCurrentLineNumber'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libfontconfig.a(fcxml.o): In function `IA__FcConfigParseAndLoad':
(.text+0x12d1): undefined reference to `XML_ParserCreate'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libfontconfig.a(fcxml.o): In function `IA__FcConfigParseAndLoad':
(.text+0x1333): undefined reference to `XML_SetUserData'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libfontconfig.a(fcxml.o): In function `IA__FcConfigParseAndLoad':
(.text+0x1345): undefined reference to `XML_SetDoctypeDeclHandler'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libfontconfig.a(fcxml.o): In function `IA__FcConfigParseAndLoad':
(.text+0x1357): undefined reference to `XML_SetElementHandler'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libfontconfig.a(fcxml.o): In function `IA__FcConfigParseAndLoad':
(.text+0x1364): undefined reference to `XML_SetCharacterDataHandler'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libfontconfig.a(fcxml.o): In function `IA__FcConfigParseAndLoad':
(.text+0x1397): undefined reference to `XML_ParseBuffer'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libfontconfig.a(fcxml.o): In function `IA__FcConfigParseAndLoad':
(.text+0x13b4): undefined reference to `XML_GetBuffer'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libfontconfig.a(fcxml.o): In function `IA__FcConfigParseAndLoad':
(.text+0x13f6): undefined reference to `XML_ParserFree'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/lib .
01`
.0j mnfontconfig.a(fcxml.o): In function `IA__FcConfigParseAndLoad':
(.text+0x1639): undefined reference to `XML_GetErrorCode'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libfontconfig.a(fcxml.o): In function `IA__FcConfigParseAndLoad':
(.text+0x1640): undefined reference to `XML_ErrorString'
collect2: error: ld returned 1 exit status

      

But I have every X Window System library I can find ...

I have no idea why I am getting errors in the standard libraries. So why is this happening and how can I fix it?

+3


source to share





All Articles