Qt Linking Error-Collection of common programming errors

I configure qt-x11 with following options

./configure -prefix /iTalk/qtx11 -prefix-install -bindir /iTalk/qtx11-install/bin -libdir /iTalk/qtx11-install/lib -docdir /iTalk/qtx11-install/doc -headerdir /iTalk/qtx11-install/include -datadir /iTalk/qtx11-install/data -examplesdir /iTalk/qtx11-install/examples -demosdir /iTalk/qtx11-install/demos -debug.

Now I am getting following errors in Fedora Core 6.

Can you please tell me where the problem is?

obj/debug-shared/qapplication_x11.o: In function `qt_init(QApplicationPrivate*, int, _XDisplay*, unsigned long, unsigned long)':
/iTalk/QT4/qt/src/gui/kernel/qapplication_x11.cpp:1713: undefined reference to `FcInit'
.obj/debug-shared/qfontdatabase.o: In function `queryFont':
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1727: undefined reference to `FcFreeTypeQuery'
.obj/debug-shared/qfontdatabase.o: In function `registerFont':
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1959: undefined reference to `FcConfigGetCurrent'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1963: undefined reference to `FcConfigGetFonts'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1965: undefined reference to `FcConfigAppFontAddFile'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1966: undefined reference to `FcConfigGetFonts'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1985: undefined reference to `FcConfigGetBlanks'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1997: undefined reference to `FcPatternDel'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1998: undefined reference to `FcPatternAddString'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:2001: undefined reference to `FcPatternGetString'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:2006: undefined reference to `FcFontSetAdd'
.obj/debug-shared/qfontdatabase.o: In function `qt_FcPatternToQFontDef(_FcPattern*, QFontDef const&)':
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:746: undefined reference to `FcPatternGetString'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:751: undefined reference to `FcPatternGetDouble'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:759: undefined reference to `FcPatternGetDouble'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:771: undefined reference to `FcPatternGetInteger'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:776: undefined reference to `FcPatternGetInteger'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:786: undefined reference to `FcPatternGetBool'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:793: undefined reference to `FcPatternGetInteger'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:800: undefined reference to `FcPatternGetInteger'
.obj/debug-shared/qfontdatabase.o: In function `FcFontSetRemove':
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1573: undefined reference to `FcPatternDestroy'
.obj/debug-shared/qfontdatabase.o: In function `qt_fontSetForPattern(_FcPattern*, QFontDef const&)':
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1657: undefined reference to `FcFontSort'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1671: undefined reference to `FcPatternGetBool'
.obj/debug-shared/qfontdatabase.o: In function `qt_addPatternProps(_FcPattern*, int, int, QFontDef const&)':
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1449: undefined reference to `FcPatternAddInteger'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1456: undefined reference to `FcPatternAddInteger'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1459: undefined reference to `FcPatternAddDouble'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1464: undefined reference to `FcPatternAddInteger'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1468: undefined reference to `FcPatternAddBool'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1471: undefined reference to `FcPatternAddBool'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1476: undefined reference to `FcLangSetCreate'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1477: undefined reference to `FcLangSetAdd'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1478: undefined reference to `FcPatternAddLangSet'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1479: undefined reference to `FcLangSetDestroy'
.obj/debug-shared/qfontdatabase.o: In function `tryPatternLoad':
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1588: undefined reference to `FcPatternDuplicate'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1593: undefined reference to `FcConfigSubstitute'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1594: undefined reference to `FcDefaultSubstitute'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1596: undefined reference to `FcFontMatch'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1606: undefined reference to `FcPatternDuplicate'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1613: undefined reference to `FcPatternGetCharSet'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1615: undefined reference to `FcCharSetHasChar'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1619: undefined reference to `FcPatternGetLangSet'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1621: undefined reference to `FcLangSetHasLang'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1628: undefined reference to `FcPatternDel'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1629: undefined reference to `FcPatternAddBool'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1646: undefined reference to `FcPatternDestroy'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1648: undefined reference to `FcPatternDestroy'
.obj/debug-shared/qfontdatabase.o: In function `loadFontConfig':
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1023: undefined reference to `FcObjectSetCreate'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1024: undefined reference to `FcPatternCreate'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1037: undefined reference to `FcObjectSetAdd'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1040: undefined reference to `FcFontList'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1041: undefined reference to `FcObjectSetDestroy'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1042: undefined reference to `FcPatternDestroy'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1046: undefined reference to `FcPatternGetString'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1057: undefined reference to `FcPatternGetInteger'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1059: undefined reference to `FcPatternGetInteger'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1061: undefined reference to `FcPatternGetInteger'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1063: undefined reference to `FcPatternGetString'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1065: undefined reference to `FcPatternGetInteger'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1067: undefined reference to `FcPatternGetBool'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1069: undefined reference to `FcPatternGetString'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1074: undefined reference to `FcPatternGetLangSet'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1081: undefined reference to `FcLangSetHasLang'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1100: undefined reference to `FcPatternGetCharSet'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1107: undefined reference to `FcCharSetHasChar'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1116: undefined reference to `FcPatternGetString'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1136: undefined reference to `FcPatternGetInteger'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1153: undefined reference to `FcPatternGetDouble'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1161: undefined reference to `FcFontSetDestroy'
.obj/debug-shared/qfontdatabase.o: In function `getFcPattern':
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1494: undefined reference to `FcPatternCreate'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1509: undefined reference to `FcPatternAdd'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1516: undefined reference to `FcPatternAddWeak'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1524: undefined reference to `FcPatternAddWeak'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1531: undefined reference to `FcPatternAddInteger'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1533: undefined reference to `FcPatternAddBool'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1535: undefined reference to `FcPatternAddBool'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1539: undefined reference to `FcDefaultSubstitute'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1540: undefined reference to `FcConfigSubstitute'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1541: undefined reference to `FcConfigSubstitute'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1550: undefined reference to `FcPatternAddWeak'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1557: undefined reference to `FcPatternAddWeak'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1564: undefined reference to `FcPatternAddWeak'
.obj/debug-shared/qfontdatabase.o: In function `loadFc':
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1707: undefined reference to `FcFontSetDestroy'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1716: undefined reference to `FcPatternDestroy'
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:1718: undefined reference to `FcPatternDestroy'
.obj/debug-shared/qfontdatabase.o: In function `QFontDatabase::removeAllApplicationFonts()':
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:2048: undefined reference to `FcConfigAppFontClear'
.obj/debug-shared/qfontdatabase.o: In function `QFontDatabase::removeApplicationFont(int)':
/iTalk/QT4/qt/src/gui/text/qfontdatabase_x11.cpp:2027: undefined reference to `FcConfigAppFontClear'
.obj/debug-shared/qfontengine_x11.o: In function `qt_x11ft_convert_pattern(_FcPattern*, QByteArray*, int*, bool*)':
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:970: undefined reference to `FcPatternGetString'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:972: undefined reference to `FcPatternGetInteger'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:975: undefined reference to `FcPatternGetBool'
.obj/debug-shared/qfontengine_x11.o: In function `QFontEngineX11FT':
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:999: undefined reference to `FcPatternGetInteger'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:1016: undefined reference to `FcPatternGetInteger'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:1041: undefined reference to `FcPatternGetBool'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:1077: undefined reference to `FcPatternGetBool'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:1106: undefined reference to `FcPatternDestroy'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:1112: undefined reference to `FcPatternGetCharSet'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:1113: undefined reference to `FcCharSetCopy'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:1115: undefined reference to `FcPatternDestroy'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:999: undefined reference to `FcPatternGetInteger'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:1016: undefined reference to `FcPatternGetInteger'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:1041: undefined reference to `FcPatternGetBool'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:1077: undefined reference to `FcPatternGetBool'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:1106: undefined reference to `FcPatternDestroy'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:1112: undefined reference to `FcPatternGetCharSet'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:1113: undefined reference to `FcCharSetCopy'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:1115: undefined reference to `FcPatternDestroy'
.obj/debug-shared/qfontengine_x11.o: In function `engineForPattern':
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:868: undefined reference to `FcFontMatch'
.obj/debug-shared/qfontengine_x11.o: In function `QFontEngineMultiFT::loadEngine(int)':
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:929: undefined reference to `FcPatternEqual'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:932: undefined reference to `FcPatternDestroy'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:941: undefined reference to `FcPatternDuplicate'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:951: undefined reference to `FcConfigSubstitute'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:952: undefined reference to `FcDefaultSubstitute'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:956: undefined reference to `FcPatternDestroy'
.obj/debug-shared/qfontengine_x11.o: In function `~QFontEngineMultiFT':
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:895: undefined reference to `FcPatternDestroy'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:897: undefined reference to `FcPatternDestroy'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:899: undefined reference to `FcFontSetDestroy'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:895: undefined reference to `FcPatternDestroy'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:897: undefined reference to `FcPatternDestroy'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:899: undefined reference to `FcFontSetDestroy'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:895: undefined reference to `FcPatternDestroy'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:897: undefined reference to `FcPatternDestroy'
/iTalk/QT4/qt/src/gui/text/qfontengine_x11.cpp:899: undefined reference to `FcFontSetDestroy'
.obj/debug-shared/qfontengine_ft.o: In function `QFontEngineFT::stringToCMap(QChar const*, int, QGlyphLayout*, int*, QFlags) const':
/iTalk/QT4/qt/src/gui/text/qfontengine_ft.cpp:1546: undefined reference to `FcCharSetHasChar'
/iTalk/QT4/qt/src/gui/text/qfontengine_ft.cpp:1581: undefined reference to `FcCharSetHasChar'
.obj/debug-shared/qfontengine_ft.o: In function `QFreetypeFace::release(QFontEngine::FaceId const&)':
/iTalk/QT4/qt/src/gui/text/qfontengine_ft.cpp:308: undefined reference to `FcCharSetDestroy'
collect2: ld returned 1 exit status
make[1]: *** [../../lib/libQtGui.so.4.5.3] Error 1
make[1]: Leaving directory `/iTalk/QT4/qt/src/gui'
make: *** [sub-gui-make_default-ordered] Error 2

  1. You’re missing references to FontConfig.

    ./configure takes a -no-fontconfig switch, but better would be to figure out why ./configure isn’t including FontConfig properly. (The logs you posted don’t go far enough back to even figure out what the failed link command is.)

  2. the thing is that the fontconfig version provided by red hat is too old and missing a symbol (I read that it is the sub sub version number that is to low and that is causing the missing symbol). If you simply update fontconfig it doesnt seem to work for me because it finds the oldest version still but when I change the makefile to link to the newer libfontconfig.so directly it work. In your .pro file add the following line: LIB+= /path/to/your/NewFontConfiglib.so.X.X Also, simply doing a yum update doesnt work, it says package up to date, I read a post that showed how to add the newer one. Later on, I decided I need to build my app standalone so I started building a static version of Qt and got into the same problem…..I was not sure how to modify that makefile though and came across this post so hopefully it will work. Take a look at this post: CentOS 5.2 + Qt 4.5 + FcFreeTypeQueryFace

Originally posted 2013-11-27 11:52:08.