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]

Linking out a .a library


Hi,

I'm currently writing a library that I will soon implement
in a PHP module.
But PHP needs that all libraries have to be linked by the -l
option.
I made inquiries about this and i saw that, for exemple, a
-lxyz option refers to a binary object file (kind of .o)
beginning with "lib" and ending with ".a".

I have succeeded in compiling a such libxyz.a file with this
command :
gcc -c libxyz.c -o libxyz.a

But now, my library is growing and i need to develop
separate .c/.h modules and linking them together into the .a
file
Is it possible?
Because i'm frightend that if i do something like this :
"gcc -o libxyz.a libxyz.o xxx.o yyy.o zzz.o",
libxyz.a will be an executable file and won't be linkable..

********** PROTEGEZ VOS E-MAILS !********** 
Avec Tiscali SuperMail, vos e-mails en toute sécurité ! 
Anti Spam personnalisable 
Anti Virus actualisé en permanence 
et de nombreux bonus... 
Pour en savoir plus, rendez-vous sur http://www.tiscali.fr/supermail/



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