help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Linking statically


From: T
Subject: Linking statically
Date: Tue, 10 Jan 2006 18:01:41 -0500
User-agent: Pan/0.14.2.91 (As She Crawled Across the Table (Debian GNU/Linux))

Hi,

I haven't involved in C programming for quite a while. I want to confirm
this question but couldn't find in comp.lang.c FAQ, and GCC Frequently
Asked Questions. Anyway, here is the question:

How can I link a lib statically?

Although the question is simple, please answer comprehensively. I.e., what
is the command line format, what is required for the linking.
Specifically, I want to link avcodeccvs & avformat statically while lz is
linked dynamically. how can I do that? This is what I tried:

$ g++ -g -Wall -o lnk-test lnk-test.C -lz -static -lavcodeccvs -lavformat
/usr/bin/ld: cannot find -lavcodec
collect2: ld returned 1 exit status

Please note, this is ok:

$ g++ -g -Wall -o lnk-test lnk-test.C -lavcodec -lavformat -lz

Further, in the libavcodeccvs-dev package, only .so type of libs are
provided:

/usr/lib/libavcodec.so
/usr/lib/libavformat.so

please elaborate. Thanks

tong



reply via email to

[Prev in Thread] Current Thread [Next in Thread]