This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using static library


At 19.26 09/12/2002 +0100, Wojtek DHAS wrote:
Hi,
I have probably very easy question. I have some static windows library
(file.a)
Curious. I thought windows libraries were .lib files.

 and I would like to use some function from it. How to call function
from static lib ?
Le's say you need to link agains libfile.a :
1.) Put the library in the linekr search path (see gcc / binutils manual for this)
2.) #include the relevant "file.h" in your sources
3.) link with the library passing "-lfile" (the same name as the library minus the initial "lib") to gcc.

Eg., to link against libiberty.a:
1.) have libiberty.a installed somewhere
2.) #include "libiberty.h"
3.) link with "gcc mfiles.o -liberty -o executable_name"

HTH, fwyzard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]