Brentmparker
Brentmparker

Reputation:

/usr/bin/ld: cannot find -lfreetype Why? And how can I make it work?

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

Upvotes: 4

Views: 8463

Answers (4)

FeatureCreep
FeatureCreep

Reputation: 1824

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.

Upvotes: 2

Brentmparker
Brentmparker

Reputation:

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!

Upvotes: 1

Artyom
Artyom

Reputation: 31263

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

Upvotes: 5

C. K. Young
C. K. Young

Reputation: 223123

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.

Upvotes: 0

Related Questions