Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Command-line to combine obj files (.o) into a Static Library (lib.a) file.

807578Aug 3 2009 — edited Aug 5 2009
I have a library that I need to compile for Solaris 10 x86 using Sun Studio. I compile the source files to make obj files by issuing the command:

Bash-3.0# cc -c -D"_UNIX_" *.c

This compiles every source.c and produces an object.o file. (Nice, & simple.)
Now, what is the command-line to combine all those object.o files (along with a few other staticlibs.a) and make one archive, lib.a?

I've done this many times with the gnu - gcc compilers. Is it possible with the Sun Studio Tools? And where is it documented?

I thought I had this 'licked' when installed SS12u1 and built the 'Welcome' project. But I have searched the "Sun Studio 12: C User's Guide" from top to bottom, and I don't have a 'clue' :-( ...

Mike <><><>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 2 2009
Added on Aug 3 2009
5 comments
1,354 views