Operating System - HP-UX
1752630 Members
6053 Online
108788 Solutions
New Discussion юеВ

Re: problem compiling programs under hpux11.11

 
SOLVED
Go to solution
ranganath ramachandra
Esteemed Contributor

Re: problem compiling programs under hpux11.11

/usr/ccs/bin/ld: /opt/OV/lib: Not a valid object file (invalid system id)

this is because the link line had /opt/OV/lib as an input file to ld. it should have followed a '-L'. this has nothing to do with 32/64 bit. header file problems cannot be solved by changing from 32-bit to 64-bit.

as for unresolved symbols, i think compiling and linking with aCC (instead of gcc) may resolve the problem.
 
--
ranga
[i work for hpe]

Accept or Kudo

Jeroen Peereboom
Honored Contributor

Re: problem compiling programs under hpux11.11

L.S.

I ran into this message too and found a workaround in not using a C program but using a shell script. I had no time to sort things out.

Like Rohan I think you have the wrong compiler. Check:

http://forums1.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=140474

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=470708

http://forums1.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=299947

Do you trust your compiled program if you've been editing some other system files just to make it through the compiler?

JP.
ranganath ramachandra
Esteemed Contributor

Re: problem compiling programs under hpux11.11

here is the reason why the unresolved symbols appear: libraries libstd.2, libov.3 and libsnmp.3 are built with aCC. so they have references to symbols defined in libCsup.sl.
now you did not compile/link with aCC so your program does not link with libCsup.sl. hence the unresolved symbols.

there are a few ways to resolve this:

1. build your application with aCC so that libCsup is included in the link line by the compiler. all other related problems are also avoided.

2. link your application with libCsup by adding the following to CFLAGS: -lCsup

3. use LD_PRELOAD to preload libCsup at run-time. you can do this with the command
LD_PRELOAD=/usr/lib/libCsup.sl ./AlcPabxPolling

compiling and linking for PA64 instead of PA32 may solve your problem in some mysterious way but you may not be able to do it all the time.
 
--
ranga
[i work for hpe]

Accept or Kudo

ranganath ramachandra
Esteemed Contributor

Re: problem compiling programs under hpux11.11

to make it simple - because of the unresolved symbols problem i recommend that you use aCC.

if you prefer gcc, perhaps you should try compiling it with the correct version as others have suggested. if the problem of unresolved symbols is still not solved, i think using aCC is the solution.
 
--
ranga
[i work for hpe]

Accept or Kudo

khelij
Advisor

Re: problem compiling programs under hpux11.11

HI
Thank you very much for your help.
This is my first time to ask question in hp Forum and i am happy the people help me .

Actually , i have delete GCC 3.3.2 and install GCC 3.3.3
I have change may makefile
I have delete this libs :
-lsocket -lXm /usr/lib/libC.so.5

This is my actual makefile
############################################
LIBPATH = -L/opt/OV/lib -L/opt/IXImd12s/lib
SNMP_LIBPATH = -L/opt/OV/lib -L/opt/IXImd12s/lib
OVW_LIBPATH = -L /opt/OV/lib -L /usr/dt/lib -R /opt/OV/lib
CFLAGS = -g -w -I /opt/OV/include -I. -L $(SNMP_LIBPATH) -L /opt/OV/lib -D_XOPEN_SOURCE_EXTENDED
LIBS = -lovsnmp -lovw -lov -lnsl
CC = /usr/local/bin/gcc

LIBS = -lovsnmp -lovw -lov -lsocket -lnsl -lXm /usr/lib/libC.so.5

############################################

When i compile my binary i have this message :
/usr/lib/dld.sl: Unresolved symbol:[Vtable]key:__dt__9exceptionFv (data)from/usr/lib/libstd.2
/usr/lib/dld.sl: Unresolved symbol:typeid__XT9exception_ (data) from /opt/OV/lib/libov.3
/usr/lib/dld.sl: Unresolved symbol:[Vtable]key:__dt__21__versioned_type_infoFv (data) from /opt/OV/lib/libov.3
/usr/lib/dld.sl: Unresolved symbol: __bad_exception(data) from /opt/OV/lib/libov.3
/usr/lib/dld.sl: Unresolved symbol:__bad_alloc_exception (data) from /opt/OV/lib/libov.3
/usr/lib/dld.sl: Unresolved symbol: __curStaticObject(data) from /opt/OV/lib/libov.3
/usr/lib/dld.sl: Unresolved symbol: __curStaticObject(data) from /usr/lib/libstd.2
/usr/lib/dld.sl: Unresolved symbol:typeid__XT9exception_ (data) from /usr/lib/libstd.2
/usr/lib/dld.sl: Unresolved symbol:[Vtable]key:__dt__21__versioned_type_infoFv (data) from /usr/lib/libstd.2
/usr/lib/dld.sl: Unresolved symbol: __bad_exception(data) from /usr/lib/libstd.2
/usr/lib/dld.sl: Unresolved symbol:__bad_alloc_exception (data) from /usr/lib/libstd.2
/usr/lib/dld.sl: Unresolved symbol:typeid__XT9exception_ (data) from/opt/OV/lib/libovsnmp.3
/usr/lib/dld.sl: Unresolved symbol: __bad_exception(data) from /opt/OV/lib/libovsnmp.3
/usr/lib/dld.sl: Unresolved symbol:__bad_alloc_exception (data) from/opt/OV/lib/libovsnmp.3
/usr/lib/dld.sl: Unresolved symbol: __curStaticObject(data) from /opt/OV/lib/libovsnmp.3
/usr/lib/dld.sl: Unresolved symbol:[Vtable]key:__dt__21__versioned_type_infoFv (data) from /opt/OV/lib/libovsnmp.3
Abort(coredump)

########################################"

I think , i have Link pb with systeme and HPOV library
/opt/OV/lib/libov.3
/opt/OV/lib/libovsnmp.3
/usr/lib/dld.sl

Monday, i make test to find the lib with ldconfig and find this libraries :
-lsocket -lXm /usr/lib/libC.so.5

Thank you very much

Fedia from France

ranganath ramachandra
Esteemed Contributor

Re: problem compiling programs under hpux11.11

try aCC if you have it.
 
--
ranga
[i work for hpe]

Accept or Kudo

Julien_13
New Member

Re: problem compiling programs under hpux11.11

Here is the solution (there were missing LIBS flags) :
LIBPATH = -L/opt/OV/lib
SNMP_LIBPATH = -L /opt/IXImd12s/lib
CFLAGS = -g -w -I/opt/OV/include -I. $(SNMP_LIBPATH) -L /opt/OV/lib -L /usr/dt/lib
LIBS = -lovsnmp -lovw -lov -lnsl -lstd -lstream -lCsup -lm -lcl -ldld
CC = /usr/local/bin/gcc