tags:

views:

1856

answers:

6

Exact duplicate:

/usr/bin/ld: cannot find -lfreetype qt


Hi, I'm writing a cross-platform Qt application for a graduate project. I've been working with Qt 4.3, but just recently upgraded to 4.5. On my Windows machine, it works great. No problems. However, on my Linux machine, things aren't quite so nice.

I'm using the Qt creator and it goes through the compiling process making all the object files. But then it makes a call to:

g++ -Wl, -rpath, (all the .o files here) -L/media/HOME/Qt-Linux-4.5/qt/lib -lQtGui -L/media/HOME/Qt-Linux-4.5/qt/lib -L/usr/X11R6/lib -pthread -lfreetype -lgobject-2.0 -lrt -lglib-2.0 -ldl -lpthread

It gives me the error:

/usr/bin/ld: cannot find -lfreetype collect2: ld returned 1 exit status

Now, I can locate libfreetype.so.6 and libfreetype.so.6.3.18 in my /usr/lib folders. I've tried running this inserting -L/usr/lib, but that didn't work. I've tried ln -s /usr/lib/libfreetype.so.6.3.18 libfreetype.so, I've tried editing the ld.so.conf file.

I'm trying this on an eeepc with Eeebuntu, if that helps.

Help!! I've been trying to get this to work for two days. I don't know what else I can do. Any suggestions?

Thanks much! Brent

A: 

When you did your ln -s /usr/lib/libfreetype.so.6.3.18 libfreetype.so, did you make sure that the libfreetype.so symlink ended up in /usr/lib too? To be sure, run ls -l /usr/lib/libfreetype.so and make sure it says what you expect it to.

Chris Jester-Young
+3  A: 

You missing dev librart, install libfreetypeX-dev, in debian lenny it would be apt-get install libfreetype6-dev

sudo apt-get install libfreetype6-dev

I've tried ln -s /usr/lib/libfreetype.so.6.3.18 libfreetype.so

Never do things like that unless you want to break your system and learn how to fix it

Artyom
Heh, thanks for the advice. I don't really want to learn how to fix my computer right now. I just want it to work and I was trying everything I could find.
+1  A: 

Thanks a lot! Installing the dev libraries got it to work. there were about five more libraries I had to install as well, but once I got them all, everything compiles just fine. Thanks a lot everyone!

+2  A: 

These I had to install on Kubuntu 9.04 64 bit in order to get a simple test app to build:

sudo apt-get install libfreetype6-dev
sudo apt-get install libavahi-gobject-dev
sudo apt-get install libSM-dev
sudo apt-get install libXrender-dev
sudo apt-get install libfontconfig-dev
sudo apt-get install libXext-dev

Edit: To get OpenGL to build I also had to install libgl1-mesa-dev and freeglut3-dev.

Edit2: Audio required libphonon-dev.

FeatureCreep
Thanks! I was having trouble finding out where to get all the missing packages.
Luis Soeiro
Thanks for the libs. Now it compiles.
cmdev
A: 

sudo apt-get install libfreetype6-dev
sudo apt-get install
libavahi-gobject-dev sudo apt-get
install libSM-dev sudo apt-get install
libXrender-dev sudo apt-get install
libfontconfig-dev sudo apt-get install libXext-dev

Worked for me - THANKS!

A: 

It works! Thanks a lot !!

LJH