problem compiling programs under hpux11.11 (497 Views)
Reply
Advisor
khelij
Posts: 26
Registered: ‎06-24-2004
Message 1 of 27 (497 Views)
Accepted Solution

problem compiling programs under hpux11.11

hello everyone, I have problem compiling programs under hpux11.11 and gcc3.3.2for example, when i compiling my programm it always show error
============================
# make
/usr/local/bin/gcc -g -I/opt/OV/include -L/opt/OV/lib -c AlcPabxPolling.c
In file included from /opt/OV/include/OV/OVsnmpApi.h:60,
from /opt/OV/include/OV/OVsnmp.h:46,
from AlcPabxPolling.c:25:
/usr/include/sys/socket.h:484: error: erreur d'analyse syntaxique before "sendfile"
/usr/include/sys/socket.h:484: error: erreur d'analyse syntaxique before "bsize_t"
/usr/include/sys/socket.h:486: error: erreur d'analyse syntaxique before "sendpath"
/usr/include/sys/socket.h:486: error: erreur d'analyse syntaxique before "bsize_t"
*** Erreur - code de sortie 1

Arrêt.
=========================================

Anyone can help me? Thanks in advance.I have attach the makefile in attachmen
Esteemed Contributor
Nicolas Dumeige
Posts: 476
Registered: ‎06-12-2003
Message 2 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

Bonjour

How did you install gcc, compilation / binaries ?

Have you install patch PHSS_28871 ?
( http://www.spinics.net/lists/gcchelp/msg02273.html )

A+

Nicolas
All different, all Unix
Advisor
khelij
Posts: 26
Registered: ‎06-24-2004
Message 3 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

i have install gcc 3.3.2 with swinstall
I do not know how command to list the patch on my hpux
Advisor
khelij
Posts: 26
Registered: ‎06-24-2004
Message 4 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

can you help me please
fedia
Frequent Advisor
Dan Martin_1
Posts: 64
Registered: ‎02-19-2003
Message 5 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

swlist -l product | grep PHSS_28871

or

swlist -l product | grep -i gcc

Dan
Esteemed Contributor
ranganath ramachandra
Posts: 375
Registered: ‎05-16-2003
Message 6 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

i dont think this has anything to do with PHSS_28871 (a linker/loader patch) because the build did not even reach the link stage, and no linker/loader/related include files are involved.

the problem is that gcc supplies its own sys/types.h which does not define the type sbsize_t, which is defined in HP-supplied /usr/include/sys/types.h. so you may consider adding this piece to gcc-supplied
sys/types.h .

# ifndef _BSIZE_T
# define _BSIZE_T
# if defined(_APP32_64BIT_OFF_T) || defined(_KERNEL)
typedef int64_t sbsize_t; /* signed length in bytes */
typedef uint64_t bsize_t; /* unsigned length in bytes */
# else
typedef long sbsize_t;
typedef unsigned long bsize_t;
# endif
# endif /* _BSIZE_T */

or, include /usr/include/sys/types.h instead of the gcc-supplied one (not sure if that will work well in all respects).
Advisor
Rohan_7
Posts: 15
Registered: ‎02-03-2004
Message 7 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

hi

this is a problem with GCC version that you have installed. You would be having GCC for HP-UX 11.00 rather than HP-UX11.11. If you have installed binary version of GCC 3.3.2 then this could happen.
Best way is to compile GCC on you machine.

Another solution is to add "-D_XOPEN_SOURCE_EXTENDED" in the compiler flags. With this the code compiles properly.
But I am not sure if there are any direct/indirect bad implications of this.

If you want to compile GCC, this thread would be helpfull to you:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=585633


HTH
Rohan
Advisor
khelij
Posts: 26
Registered: ‎06-24-2004
Message 8 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

First of all Thank you very much ;-)

the subject to this compile is :
i have HPUX 11.11 and HPOV 6.X
J have a program developpe on C for HPOV
i want to compile this script

Firstly i have include in /usr/include/sys/types.h

# ifndef _BSIZE_T
# define _BSIZE_T
# if defined(_APP32_64BIT_OFF_T) || defined(_KERNEL)
typedef int64_t sbsize_t; /* signed length in bytes */
typedef uint64_t bsize_t; /* unsigned length in bytes */
# else
typedef long sbsize_t;
typedef unsigned long bsize_t;
# endif
# endif /* _BSIZE_T */

secondly i compile and i have a new message :

./compile
/usr/local/bin/gcc -g -w -I/opt/OV/include -I. /opt/OV/lib -c AlcPabxPolling.c
gcc: /opt/OV/lib: fichier d'entrée d'édition de liens n'est pas utilisé parce l'édition de lien n'a pas été faite
/usr/local/bin/gcc -g -w -I/opt/OV/include -I. /opt/OV/lib -c SnmpPrints.c
gcc: /opt/OV/lib: fichier d'entrée d'édition de liens n'est pas utilisé parce l'édition de lien n'a pas été faite
Linking AlcPabxPolling ...
/usr/ccs/bin/ld: /opt/OV/lib: Not a valid object file (invalid system id)
collect2: ld a retourné 1 code d'état d'exécution
*** Erreur - code de sortie 1

Arrêt.
==========================================

I think, i have probleme to put option path in makefile
i send you the mafile and the oth
Advisor
khelij
Posts: 26
Registered: ‎06-24-2004
Message 9 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

the second file
Advisor
khelij
Posts: 26
Registered: ‎06-24-2004
Message 10 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

the third
Esteemed Contributor
ranganath ramachandra
Posts: 375
Registered: ‎05-16-2003
Message 11 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

you should not be modifying /usr/include/sys/types.h - this file is fine as it is.

i meant the gcc-supplied types.h which will be in some location like
/usr/local/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.2/include/sys/types.h

this is the file that gets included when you compile with gcc because gcc's default include path has the above path first and /usr/include later.
Esteemed Contributor
ranganath ramachandra
Posts: 375
Registered: ‎05-16-2003
Message 12 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

the problem is because of the following line in the makefile:

CFLAGS = -g -w -I/opt/OV/include -I. $(SNMP_LIBPATH) /opt/OV/lib

you want to include the library lookup path but you missed the -L.

you should change that to
CFLAGS = -g -w -I/opt/OV/include -I. -L $(SNMP_LIBPATH) -L/opt/OV/lib

note that the makefile is not initializing SNMP_LIBPATH. you have to correct that.
Advisor
khelij
Posts: 26
Registered: ‎06-24-2004
Message 13 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

just a minute i make a test
Trusted Contributor
Manish Srivastava
Posts: 170
Registered: ‎05-24-2004
Message 14 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

Hi,

If you are compiling a 64bit application then add -mlp64 to the compile option. This will remove this error.

manish
Advisor
khelij
Posts: 26
Registered: ‎06-24-2004
Message 15 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

hi
i have modify the file /usr/local/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.3.2/include/sys/types.h
after i have modify the makefile
and i have another message

# ./compile -mlp64
/usr/local/bin/gcc -g -w -I/opt/OV/include -I. -L -L/opt/OV/lib -L/opt/IXImd12s/lib -L/opt/OV/lib -c AlcPabxPolling.c
/usr/local/bin/gcc -g -w -I/opt/OV/include -I. -L -L/opt/OV/lib -L/opt/IXImd12s/lib -L/opt/OV/lib -c SnmpPrints.c
Linking AlcPabxPolling ...
done
# ls
AlcPabxPolling AlcPabxPolling.o core SnmpPrints.c
AlcPabxPolling.c AlcPabxPolling_origin makefile SnmpPrints.o
AlcPabxPolling.h compile makefile_origin
# ./AlcPabxPolling
/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)
#
Trusted Contributor
Manish Srivastava
Posts: 170
Registered: ‎05-24-2004
Message 16 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

Hi,

Do not change any *.h file. These files do not have a problem. If you have changed any file then please revert the changes.

You can verify that the problem is not in the header file by compiling a small test program. Use -E option to make sure that the same header file is being included.

As for the unsatisfied symbols the libc.2 should be /usr/lib/pa20_64/libc.2. Just do a nm(1) on the library and grep the symbols which are listed as unsatisfied.

manish
Advisor
khelij
Posts: 26
Registered: ‎06-24-2004
Message 17 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

if i dont make the change in types.h i have this message

# ./compile
/usr/local/bin/gcc -g -w -I/opt/OV/include -I. -L -L/opt/OV/lib -L/opt/IXImd12s/lib -L/opt/OV/lib -c AlcPabxPolling.c
In file included from /opt/OV/include/OV/OVsnmpApi.h:60,
from /opt/OV/include/OV/OVsnmp.h:46,
from AlcPabxPolling.c:25:
/usr/include/sys/socket.h:484: error: erreur d'analyse syntaxique before "sendfile"
/usr/include/sys/socket.h:484: error: erreur d'analyse syntaxique before "bsize_t"
/usr/include/sys/socket.h:485: error: erreur d'analyse syntaxique before "sendpath"
/usr/include/sys/socket.h:485: error: erreur d'analyse syntaxique before "bsize_t"
*** Erreur - code de sortie 1

Arrêt.
#
Trusted Contributor
Manish Srivastava
Posts: 170
Registered: ‎05-24-2004
Message 18 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

Hi,

I do not see the -mlp64 option in the compile line. Please add it to the compile line.

manish
Advisor
khelij
Posts: 26
Registered: ‎06-24-2004
Message 19 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

i have make -mlp64 and i have the same message
Do you know the patch must i put on my hpux machine to turn gcc and hpov.

# ./compile -mlp64
/usr/local/bin/gcc -g -w -I/opt/OV/include -I. -L -L/opt/OV/lib -L/opt/IXImd12s/lib -L/opt/OV/lib -c AlcPabxPolling.c
In file included from /opt/OV/include/OV/OVsnmpApi.h:60,
from /opt/OV/include/OV/OVsnmp.h:46,
from AlcPabxPolling.c:25:
/usr/include/sys/socket.h:484: error: erreur d'analyse syntaxique before "sendfile"
/usr/include/sys/socket.h:484: error: erreur d'analyse syntaxique before "bsize_t"
/usr/include/sys/socket.h:485: error: erreur d'analyse syntaxique before "sendpath"
/usr/include/sys/socket.h:485: error: erreur d'analyse syntaxique before "bsize_t"
*** Erreur - code de sortie 1

Arrêt.
Trusted Contributor
Manish Srivastava
Posts: 170
Registered: ‎05-24-2004
Message 20 of 27 (497 Views)

Re: problem compiling programs under hpux11.11

Hi,

I still do not see the -mlp64 in the compile line.

# ./compile -mlp64
/usr/local/bin/gcc -g -w -I/opt/OV/include -I. -L -L/opt/OV/lib -L/opt/IXImd12s/lib -L/opt/OV/lib -c AlcPabxPolling.c


edit the file: compile and add -mlp64 in the option for gcc:

/usr/local/bin/gcc -g -w -mlp64 -I....

and then try. I have had similar problem and it was solved by this.

manish.
Esteemed Contributor
ranganath ramachandra
Posts: 375
Registered: ‎05-16-2003
Message 21 of 27 (497 Views)

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.
Honored Contributor
Jeroen Peereboom
Posts: 2,713
Registered: ‎06-26-2003
Message 22 of 27 (497 Views)

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.
Esteemed Contributor
ranganath ramachandra
Posts: 375
Registered: ‎05-16-2003
Message 23 of 27 (497 Views)

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.
Esteemed Contributor
ranganath ramachandra
Posts: 375
Registered: ‎05-16-2003
Message 24 of 27 (497 Views)

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.
Advisor
khelij
Posts: 26
Registered: ‎06-24-2004
Message 25 of 27 (497 Views)

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

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.