Skip to contentSkip to conversation

Building a program "static"

DISCUSSION Wrazlov 2 participants 2 messages Oct 29, 2002

lore
Share & tools
lore

Wrazlov

author
#0 lore raw

Hello,
I tried to build a program to be static, but it always says that some library was not found, altough it works very well if it's built normal (shared):
gcc -L/usr/qt-3.0.4/lib -lqt-mt -static program.static program.o ld says: "-lqt-mt not found"
What's wrong with the linker-options?
Thanks for helping...

#1 lore raw
Quoted 5 lines · Wrazlov

I tried to build a program to be static, but it always says that some library was not found, altough it works very well if it's built normal (shared):
gcc -L/usr/qt-3.0.4/lib -lqt-mt -static program.static program.o ld says: "-lqt-mt not found"
What's wrong with the linker-options?

If you use "-static", you must have static (".a") versions of every library which the program uses. In the above case, it's complaining that it couldn't find "libqt-mt.a".

Binary packages often don't include static libraries; in which case, you will have to build a static version of the library from source.

Signature · 1 line
Glynn Clements <[email protected]>