September 14, 2009

qtcreator-collec2-ld-returned-1-exit-status

When facing this error…

manually cd into the project QT folder and run “make”… ld would return the library name it isn’t able to locate.

Example:

[sourcecode=“bash”] [email protected]:~/Documents/Dev/QT-Progs/Test$ make g++ -Wl,-rpath,/opt/qtsdk-2009.03/qt/lib -o Test main.o testhello.o moc_testhello.o    -L/opt/qtsdk-2009.03/qt/lib -lQtGui -L/opt/qtsdk-2009.03/qt/lib -L/usr/X11R6/lib -pthread -lfreetype -lgobject-2.0 -lSM -lICE -pthread -pthread -lXrender -lfontconfig -lXext -lX11 -lQtCore -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread /usr/bin/ld: cannot find -lfreetype collect2: ld returned 1 exit status make: *** [Test] Error 1 [/sourcecode]

Note the “cannot find -lfreetype”.. now note it can be any other library, depending on your current system configuration.

In most cases, install the devel package associated with this library.

Debian/Ubuntu “apt-get install libfreetype6-dev” for example.

Now, re-run the “make” and observe for further errors…