Visit Our UNIX and Linux User Community


how to create .so files from .o files in HP-UX


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users how to create .so files from .o files in HP-UX
# 1  
Old 10-30-2009
how to create .so files from .o files in HP-UX

Hi,
I need to create .so files from .o files(compiled c files) in HP-UX env. I dont have GCC in the HP-UX server. Is there any other way to create without using GCC.

I have done this in solaris.I had been using this command
Code:
/opt/SUNONE8/SUNWspro/bin/cc -G -o  abc.so ./abc.o $ORACLE_HOME/lib/libsqlplus.a -lc -lcrypt

for creating .so files from .o files (compiled c files) in sun OS.
Now i have to create the same in HP-UX. Please give me the HP equivalent tool/command which creates .so files like in SUN (no GCC).

Thanks in Advance.
# 2  
Old 10-30-2009
do you know what it is the HPUX compiler 'cc' ???

I think you should use the options: "-shared -o " to create dynamic library.
# 3  
Old 10-30-2009
i used cc. But with options "-G -o" as i used in solaris. Its throwing this error
Quote:
(Bundled) cc: warning 480: The -G option is available only with the C/ANSI C product; ignored.
/usr/ccs/bin/ld: Unsatisfied symbols:
main (Not referenced yet! Probably due to -u option)
i used "-s -o", and got this error,
Quote:
/usr/ccs/bin/ld: Unsatisfied symbols:
main (Not referenced yet! Probably due to -u option)
if i give "-shared -o", it shows "options -h a r e d not available,ignored".
# 4  
Old 10-30-2009
Oh, sorry, i think that i was mistaken about the platform.

Try this:

Code:
   $ ld -b -o libfunctions.sl function1.o function2.o function3.o

# 5  
Old 10-30-2009
Looks like you are using the HPUX cc which is a basic KR c , its there mainly to recompile the HPUX kernel...
Either you pay for HP ANSI C (but there is a C++ lib patch...free... used for e.g. oracle...)
Or you install gcc you get at your prefered HP archive&porting site

---------- Post updated at 14:34 ---------- Previous update was at 11:05 ----------

You can download from here:
Search Archive 2.0.0
# 6  
Old 11-06-2009
Debian

It worked... It worked..SmilieSmilie

I am able to build the so's using ld command. Thanks Pgodorica, VBE.. u r great....

Previous Thread | Next Thread
Test Your Knowledge in Computers #24
Difficulty: Medium
Raphael Henley developed the QWERTY keyboard.
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Create several files from one

good morning friends I have a problem , I have a file with 2 million records, but that can be variable, I need to split that file and drop several files in 500,000 thousand records, someone can help me with some unix shell code thank you!!! (7 Replies)
Discussion started by: tricampeon81
7 Replies

2. Shell Programming and Scripting

Can I create 3 files in one command

Hi Gurus, I need to separate a file to 3 (based on column 1 value). I have code like below. it works. awk -F"|" '$1=="H" {print $0}' ${filename} > ${hea_name} awk -F"|" '$1=="D" {print $0}' ${filename} > ${det_name} awk -F"|" '$1=="T" {print $0}' ${filename} > ${tra_name} is it possible... (7 Replies)
Discussion started by: ken6503
7 Replies

3. Shell Programming and Scripting

How to create or convert to pdf files from csv files using shell script?

Hi, Can anyone help me how to convert a .csv file to a .pdf file using shell script Thanks (2 Replies)
Discussion started by: ssk250
2 Replies

4. Shell Programming and Scripting

Create multiple files

dear all suppose I have two files file_000 and file_id: file_000: blablablabla000blablabla000 000blahblah000blahblah blah000blahblahfile_id: 001 002 003now, based on file_id, I want to create 3 files; the name of each file would be file_001,file_002,file_003,respectively, and the... (4 Replies)
Discussion started by: littlewenwen
4 Replies

5. Shell Programming and Scripting

Create multiple zip files each containing 50 xml files.

Hi, Is there a direct command or need to write a shell script for following requirement? Everyday a folder is populated with approx 25k to 30k xml files. I need to create multiple zip files in the same folder each containing 50 xml files. The last zip file may or may not contain 50 xml files.... (6 Replies)
Discussion started by: Rakesh Thobula
6 Replies

6. Shell Programming and Scripting

How to create zip/gz/tar files for if the files are older than particular days in UNIX or Linux?

I need a script file for backup (zip or tar or gz) of old log files in our unix server (causing the space problem). Could you please help me to create the zip or gz files for each log files in current directory and sub-directories also? I found one command which is to create gz file for the... (4 Replies)
Discussion started by: Mallikgm
4 Replies

7. Shell Programming and Scripting

How to Create files using Nano?

I need to switch files in a directory using Nano thinking i have all the files in the same directory? how would i go about doing that ? (2 Replies)
Discussion started by: JuankyKong
2 Replies

8. UNIX for Dummies Questions & Answers

Create individual tgz files from a set of files

Hello I have a ton of files in a directory of the format app.log.2008-04-04 I'd like to run a command that would archive each of these files as app.log.2008-04-04.tgz I tried a few combinations of find with xargs etc but no luck. Thanks Amit (4 Replies)
Discussion started by: amitg
4 Replies

9. UNIX for Dummies Questions & Answers

on how to create files

hi guys! i want my user to create some new files in a directory: i would like the user to choose a file name and then to create some kind of user friendly utility that makes my user write what he/she wants in the file and then save it in the chosen directory. let's say that in my programme i... (2 Replies)
Discussion started by: fiol73
2 Replies

Featured Tech Videos