2015-04-05 11 views
14

Ich installierte Qt5.4 mit dem Online-Installer (auf Ubuntu 14). Ich versuche, meine C++ Quelle und Link gegen libQt5Core zu kompilieren, aber ld einen Fehler aus:Verbindung gegen libQt5Core

make 
g++ -Wall test.o Party.o Communication.o FileParser.o PeerConnection.o ServerModule.o Utilities.o -o party -g -L/home/bush/Qt/5.4/gcc_64/lib -L/usr/lib/x86_64-linux-gnu/ -lQt5Core -lboost_system -lpthread 
/usr/bin/ld: warning: libicui18n.so.53, needed by /home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so, not found (try using -rpath or -rpath-link) 
/usr/bin/ld: warning: libicuuc.so.53, needed by /home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so, not found (try using -rpath or -rpath-link) 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_setMillis_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_fromUnicode_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_get_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_inDaylightTime_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_open_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_countAvailable_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_countAliases_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `u_errorName_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_openCountryTimeZones_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `u_strToUpper_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_getDefaultName_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `uenum_next_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucol_strcoll_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_getMaxCharSize_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_getAvailableName_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucol_open_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_getTimeZoneDisplayName_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_toUnicode_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `uenum_close_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucol_getSortKey_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_getAlias_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_close_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucol_setAttribute_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_close_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_openTimeZoneIDEnumeration_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_openTimeZones_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_getStandardName_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucol_close_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_compareNames_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_clone_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `u_strToLower_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_getDefaultTimeZone_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_open_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_setSubstChars_53' 
/home/bush/Qt/5.4/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_getDSTSavings_53' 
collect2: error: ld returned 1 exit status 
make: *** [party] Error 1 

Meine Make-Datei ist:

CPPFLAGS=-g -c --std=c++0x -I/usr/include -I/home/bush/Qt/5.4/gcc_64/include -I/home/bush/Qt/5.4/gcc_64/include/QtCore -I/usr/include/boost 
LDFLAGS=-g -L/home/bush/Qt/5.4/gcc_64/lib -L/usr/lib/x86_64-linux-gnu/ -lQt5Core -lboost_system -lpthread 

all:party 

party:test.o Party.o Communication.o FileParser.o PeerConnection.o ServerModule.o Utilities.o 
    g++ -Wall $^ -o party $(LDFLAGS) 

test.o:test.cpp 
    g++ $(CPPFLAGS) test.cpp 
Party.o:Party.cpp 
    g++ $(CPPFLAGS) Party.cpp 
Communication.o:Communication.cpp 
    g++ $(CPPFLAGS) Communication.cpp 
FileParser.o:FileParser.cpp 
    g++ -fPIC $(CPPFLAGS) FileParser.cpp 
PeerConnection.o:PeerConnection.cpp 
    g++ $(CPPFLAGS) PeerConnection.cpp 
ServerModule.o:ServerModule.cpp 
    g++ $(CPPFLAGS) ServerModule.cpp 
Utilities.o:Utilities.cpp 
    g++ $(CPPFLAGS) Utilities.cpp 
+0

OS kann nicht icu v53 Bibliotheken finden (qt wurde gegen diese Version verknüpft), überprüfen Sie für 'libicui18n' in'/usr/lib64' – gengisdave

+0

No such Bibliothek .. – Bush

+0

Sie es installieren lösen können, oder wenn Sie eine andere Version von icu haben, fälschen es mit einem symbolischen Link – gengisdave

Antwort

-1

Try -licuuc zum LDFLAGS der Make-Datei hinzuzufügen.

sudo apt-get install libicu-dev
3

In meinem Fall ist es, nachdem ich drei symbolische Links gemacht. Die lib wurde installiert, aber ich hatte eine neuere Version (55) als die erwartete (54).

sudo ln -s /usr/local/Qt/5.5/gcc_64/lib/libicui18n.so.54 /usr/lib/x86_64-linux-gnu/libicui18n.so.54 
sudo ln -s /usr/local/Qt/5.5/gcc_64/lib/libicuuc.so.54 /usr/lib/x86_64-linux-gnu/libicuuc.so.54 
sudo ln -s /usr/local/Qt/5.5/gcc_64/lib/libicudata.so.54 /usr/lib/x86_64-linux-gnu/libicudata.so.54 
0

Ich bekomme diese Fehlermeldung, wenn ich Iris unter Ubuntu zu bauen versuchte. Ich löste es durch das Entfernen CONFIG + = static aus dem .proDatei

11

ich über das gleiche Problem kam. aber ich finde meinen Ausweg nur durch diesen Code.

export LD_LIBRARY_PATH=/usr/local/Qt/5.5/gcc_64/lib:$LD_LIBRARY_PATH 
+1

oder welchen Pfad auch immer Sie installiert haben Qt to ... aber, ja, das funktioniert und ist die richtige Antwort. –

+1

Ja, das ist die richtige Antwort, aber verwenden Sie Ihren spezifischen Installationspfad wie zuvor erwähnt. Ich habe festgestellt, dass "ldd libQt5Core.so.5 "im richtigen Verzeichnis schlägt fehl, wenn LD_LIBRARY_PATH nicht richtig gesetzt ist. Ich denke, was passiert (sicherlich für mich) ist, dass wenn die Haupt-ausführbare Datei erstellt wird, der Bibliotheks-Runpath der Elf auf den richtigen Ort gesetzt wird, so dass libQt5Core in Ordnung ist libQt5Core versucht wiederum, das obige SO zu finden, das fehlschlägt, weil es keinen Laufpfad und keine LD_LIBRARY_PATH hat – mark

3

ich solche Fehler, wenn ich versuche, mein Projekt unter Debian 8 zu bauen (mit libicu52 aus offiziellen Repository) von QtCreator. Ich löste es, indem ich 'Umgebung' für mein Qt Kit (5.8.0) zu: LD_LIBRARY_PATH =/opt/Qt/5.8/gcc_64/lib: $ {LD_LIBRARY_PATH} änderte.

Screenshot: Changes marked by red line