Languages and Scripting

Error compiling pro*c thru make in HP-UX

 
Tushar Dey
New Member

Error compiling pro*c thru make in HP-UX

Hello,

I am getting following errors when compiling a pro*c program. My Pro*C programs used to work in in HP UX 10.20 but stopped working in HP UX 11.0.

================== ERROR message ===============
Precompiling prb_ptax.pc
cc -I. -O -Aa -Wl,-aarchive -L/cal/oracle/lib -o prb_ptax prb_ptax.c /cal/oracle
/lib/libsql.a /cal/oracle/lib/osntab.o -lsqlnet -lora /cal/oracle/lib/libpls.a -
lsqlnet -lnlsrtl -lcv6 -lcore -lnlsrtl -lcv6 -lcore -lcl -lm
(Bundled) cc: warning 480: The -O option is available only with the C/ANSI C pro
duct; ignored.
(Bundled) cc: warning 480: The -A option is available only with the C/ANSI C pro
duct; ignored.
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (prb_ptax.o) was dete
cted. The linked output may not run on a PA 1.x system.
/usr/ccs/bin/ld: Unsatisfied symbols:
shl_load (code)
shl_findsym (code)
*** Error exit code 1

Stop.
================== ERROR message ===============
12 REPLIES 12
James R. Ferguson
Acclaimed Contributor

Re: Error compiling pro*c thru make in HP-UX

Hi:

The error: "(Bundled) cc: warning 480: The -A option is available only with the C/ANSI C product; ignored."

...tells you that you are using the sleletal bundled C compiler only useful for basic kernel support and not a full-fledged ANSI C one. It would appear that you had licensed the ANSI C compiler on 10.20 but did not do so (or did not install) the same on your 11.x server.

Remember, 11.0 is out-of-support. The ANSI C compiler would be on one of the Application CDs but will require a codeword to unlock.

Regards!

...JRF...

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: Error compiling pro*c thru make in HP-UX

ld: Unsatisfied symbols: shl_load shl_findsym

This occurs because you have illegally used -Wl,-aarchive.
Either leave it out or use -Wl,-aarchive_shared

Also as JRF mentioned, you shouldn't be using the bundled C compiler to develop applications.
Tushar Dey
New Member

Re: Error compiling pro*c thru make in HP-UX

Hi Gurus,

My priority is to work on the errors. So, can you please suggest me any workaround on the errors 'shl_load' and 'shl_fiindsym'. For the time being I am ignoring the warnings regarding cc comand line options options '-O' and '-A'.

Regards,
Tushar
Dennis Handly
Acclaimed Contributor

Re: Error compiling pro*c thru make in HP-UX

>can you please suggest me any workaround

I mentioned exactly why you got them.
Roberto Arias
Valued Contributor

Re: Error compiling pro*c thru make in HP-UX

Hi all

You must install compiler for HP-UX 11x . Isuggest you ANSI/C (HP software) o gcc (GNU software

rgds
The man is your friend
Bill Hassell
Honored Contributor

Re: Error compiling pro*c thru make in HP-UX

You do not have a compiler on the new system that will work. You must purchase the ANSI/C compiler (as was done on the old 10.20 system) or try using the free gcc compiler.


Bill Hassell, sysadmin
Tushar Dey
New Member

Re: Error compiling pro*c thru make in HP-UX

Hi All,

Thanks for suggestion that takes me towards installing the developer packs / gcc.

Meanwhile, I tried to compile by removing LDFLAGS "-Wl,-aarchive" and compiled as follows
---------------
cc -I. -O -Aa -L/cal/oracle/lib -o prb_ptax prb_ptax.c /cal/oracle/lib/libsql.a
/cal/oracle/lib/osntab.o -lsqlnet -lora /cal/oracle/lib/libpls.a -lsqlnet -lnlsr
tl -lcv6 -lcore -lnlsrtl -lcv6 -lcore -lcl -lm
(Bundled) cc: warning 480: The -O option is available only with the C/ANSI C pro
duct; ignored.
(Bundled) cc: warning 480: The -A option is available only with the C/ANSI C pro
duct; ignored.
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (prb_ptax.o) was dete
cted. The linked output may not run on a PA 1.x system.
---------------

But, finally when I executed the binary, I got following error -
/usr/lib/dld.sl: Can't open shared library: /usr/lib/libc.2

Any 2nd thought on this?

Regards,
Tushar
Dennis Handly
Acclaimed Contributor

Re: Error compiling pro*c thru make in HP-UX

>finally when I executed the binary, I got following error-
dld.sl: Can't open shared library: /usr/lib/libc.2

My crystal ball says you took your executable that you developed on 11.00 and tried to execute it on 10.20. That won't work and wouldn't work even if you could use -Wl,-aarchive.

Only forward compatibility is supported.
Tushar Dey
New Member

Re: Error compiling pro*c thru make in HP-UX

Hi Dennis,

You are absolutely correct.

1. I tried to compile in new box HP UX 11.00 without option '-aacrchive'. It worked.

2. I copied the executable to HP UX 10.20. It gave an error -
/usr/lib/dld.sl: Can't open shared library: /usr/lib/libc.2
/usr/lib/dld.sl: No such file or directory

3. When tried to HP UX 10.20 box now it gives -
core dump at precompilation itself.

Thanks.