1833311 Members
2964 Online
110051 Solutions
New Discussion

C Compilation in HP-UX

 
SOLVED
Go to solution
Sutapa Dey
Frequent Advisor

C Compilation in HP-UX

Hi All,

I have some C-Files with .c extension and I need to compile them such that after compilation they become files with .so extension (means shared objects)

Need to know :
1. The dependencies to be installed before I go for the compilation - Like listing whether the proper library files are there which will be required for compilation.

2. Me being a novice in this field also need to know the commandline options I need to pass in order to compile the .c functions to get the .sl extn files.

Please help.

Regards,
Sutapa
2 REPLIES 2
Dennis Handly
Acclaimed Contributor

Re: C Compilation in HP-UX

>they become files with .so extension

Typically you compile more than one source to create a shared lib.

>1. The dependencies to be installed before I go for the compilation - Like listing whether the proper library files are there which will be required for compilation.

This is something only you would know.
Typically libs are only needed for linking, not compiling.

>2. the command line options I need to pass in order to compile the .c functions to get the .sl

For PA:
cc -c +z foo1.c ...
cc -b -o libbar.sl foo1.o ...
http://docs.hp.com/en/14672/Help/libs.htm#createlib

For IPF:
cc -c foo1.c ...
cc -b -o libbar.so foo1.o ...
http://docs.hp.com/en/14487/libs.htm#createlib
Dennis Handly
Acclaimed Contributor
Solution

Re: C Compilation in HP-UX

If you have gotten the answers you wanted, please read the following about how to assign points:
http://forums.itrc.hp.com/service/forums/helptips.do?#33