Date: Tue, 23 Jan 1996 15:13:16 +0200 (IST) From: Eli Zaretskii To: Werner Drescher Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: Liberies On Tue, 23 Jan 1996, Werner Drescher wrote: > I wrote some own class-functions in C++ and now I want to make a > libery-file out of them. I have the C++ file *.cc the header-file *.h and > I want now the *.a file so that I can link it with the -l option. > How can I do this ? Compile your file with `gcc -c file.cc', then use the program called `ar', like this: ar rvs libmylib.a file.o You can then link against this library like this: gcc main.c sub.c -o myprog -lmylib Note that your library name *must* begin with `lib' for the linker to find it when you use -l switch.