how to compile .a

Hi - this is very simple but has been driving me nuts. How exactly do I
compile a statically linked library? (ie create a .a from a .c. what flags
must I set in qcc – the -A always tells me ar can’t find Foo@a) an actual
command would be great.

Thanks,
Jason

Jason Ahmad <jahmad@stanford.edu> wrote:

Hi - this is very simple but has been driving me nuts. How exactly do I
compile a statically linked library? (ie create a .a from a .c. what flags
must I set in qcc – the -A always tells me ar can’t find Foo@a) an actual
command would be great.

Look into the help for the “ar” utility. .a files are traditionally called
archives.

chris


Chris McKillop <cdm@qnx.com> “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/

“Jason Ahmad” <jahmad@stanford.edu> wrote in message
news:ad8mt3$ssi$1@inn.qnx.com

Hi - this is very simple but has been driving me nuts. How exactly do I
compile a statically linked library? (ie create a .a from a .c. what flags
must I set in qcc – the -A always tells me ar can’t find Foo@a) an actual
command would be great.

Compiler only creates object files. Thus to create a .a file you need to
use
to ar program to take these object files and bundle them into libraries.

Thanks,
Jason

cc -c -o file1.o file1.c
cc -c -o file2.o file2.c
cc -A file.a file1.o file2.o

Marty Doane
Siemens Dematic

“Jason Ahmad” <jahmad@stanford.edu> wrote in message
news:ad8mt3$ssi$1@inn.qnx.com

Hi - this is very simple but has been driving me nuts. How exactly do I
compile a statically linked library? (ie create a .a from a .c. what flags
must I set in qcc – the -A always tells me ar can’t find Foo@a) an actual
command would be great.

Thanks,
Jason