Unix Technical Forum

Problems with compiling a program on HPUX 11.11

This is a discussion on Problems with compiling a program on HPUX 11.11 within the HP-UX Operating System forums, part of the Unix Operating Systems category; --> Hi out there, I've got a problem. I'm trying to compile a C-programm on HPUX 11.11. The compilin runs ...


Go Back   Unix Technical Forum > Unix Operating Systems > HP-UX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 07:38 PM
nil.heid@gmx.de
 
Posts: n/a
Default Problems with compiling a program on HPUX 11.11

Hi out there,
I've got a problem. I'm trying to compile a C-programm on HPUX 11.11.
The compilin runs well but when the linker starts I've got following
message:
Not a valid library (invalid magic number). Possibly a 64-bit PA
archive library (Mismatched ABI).
The program is trying to link the SAP-RFCSDK to my prog.
the gcc compilter is conifgured with following value:
Using built-in specs.
Target: hppa2.0w-hp-hpux11.11
Configured with: ../gcc/configure
Thread model: single
gcc version 4.0.2


I tried a few compinations of flags but nothing I tried yet was
working.
At the moment I'm trying to compile with the flag -mpa-risc-2-0
and linking with the flag -mlp64.


Does anyone here knows where my problem could be?


Thanks in advance


Markus


P.S. If you need further information just ask.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 07:38 PM
Uli Link
 
Posts: n/a
Default Re: Problems with compiling a program on HPUX 11.11

nil.heid@gmx.de schrieb:

> Not a valid library (invalid magic number). Possibly a 64-bit PA
> archive library (Mismatched ABI).
> The program is trying to link the SAP-RFCSDK to my prog.
> the gcc compilter is conifgured with following value:
> Using built-in specs.
> Target: hppa2.0w-hp-hpux11.11
> Configured with: ../gcc/configure
> Thread model: single
> gcc version 4.0.2


You cannot mix 32 and 64bit objects in a single program.
The compiler is configured for 64bit, so it will try linking it's 64bit
libgcc.

The PA-RISC 2.0 32bit targets of gcc are hppa2.0n-... or hppa1.1...

Figure out what type the SAP-RFCSDK libs are, and then adjust build
accordingly. Or select the correct libs of the SDK.

--
Uli
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-16-2008, 07:38 PM
Rick Jones
 
Posts: n/a
Default Re: Problems with compiling a program on HPUX 11.11

Uli Link <VonRechts.NachLinks@usenet.arcornews.de> wrote:
> nil.heid@gmx.de schrieb:


>> Not a valid library (invalid magic number). Possibly a 64-bit PA
>> archive library (Mismatched ABI).
>> The program is trying to link the SAP-RFCSDK to my prog.
>> the gcc compilter is conifgured with following value:
>> Using built-in specs.
>> Target: hppa2.0w-hp-hpux11.11
>> Configured with: ../gcc/configure
>> Thread model: single
>> gcc version 4.0.2


> You cannot mix 32 and 64bit objects in a single program.
> The compiler is configured for 64bit, so it will try linking it's
> 64bit libgcc.


> The PA-RISC 2.0 32bit targets of gcc are hppa2.0n-... or hppa1.1...


Where likely as not for 2.0 the 'n' is the key bit - standing for
Narrow. As opposed to (w)ide.

> Figure out what type the SAP-RFCSDK libs are, and then adjust build
> accordingly. Or select the correct libs of the SDK.


The file command may be sufficient to identify them.

FWIW, In HP compiler speak, 64-bit compilation is requested via +DD64 and
32-bit via +DD32. Might help if you need to do future searches for HP
compiler/gcc rosetta stones.

rick jones
--
Wisdom Teeth are impacted, people are affected by the effects of events.
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-16-2008, 07:38 PM
nosmap@example.com
 
Posts: n/a
Default Re: Problems with compiling a program on HPUX 11.11

In article <YWjmf.411$9n.353@news.cpqcorp.net>,
Rick Jones <rick.jones2@hp.com> wrote:
>Uli Link <VonRechts.NachLinks@usenet.arcornews.de> wrote:
>> nil.heid@gmx.de schrieb:

>
>>> Using built-in specs.
>>> Target: hppa2.0w-hp-hpux11.11

>
>> You cannot mix 32 and 64bit objects in a single program.
>> The compiler is configured for 64bit, so it will try linking it's
>> 64bit libgcc.

>
>> The PA-RISC 2.0 32bit targets of gcc are hppa2.0n-... or hppa1.1...


Actually, this GCC compiler is a 32 bit compiler. In GCC terminology,
hppa2.0w is a 32 bit target on 64 bit capable hardware. If this were
the 64 bit PA GCC it would have a target of hppa64-hp-hpux11.11.

So the problem is that he has a 32 bit compiler but a 64 bit library
somewhere.

Steve Ellcey
sje <AT> cup . hp . com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-16-2008, 07:39 PM
Markus
 
Posts: n/a
Default Re: Problems with compiling a program on HPUX 11.11

[...]
> Figure out what type the SAP-RFCSDK libs are, and then adjust build
> accordingly. Or select the correct libs of the SDK.
>


SAP RFC-SDK is compiled and linked with HPs aCC compiler, no chance to
use gcc.

Quote from note 11682:

[...]
* HP-UX 11.0

cc -DSAPonUNIX -z +DD64 -Ae +w1 -DSAPwithTHREADS -D_REENTRANT
-D_POSIX_C_SOURCE=199506L -DSAPonHPPA -c sapinfo.c

/opt/aCC/bin/aCC +DD64 -Wl,+n -lnsl -Wl,-a,default -lpthread -ldld -lsec
-L. -LRFCSDK/lib -o sapinfo sapinfo.o librfccm.sl

On HP 32-bit platform, the option +DD64 must not be transferred to the
Compile.

or for Unicode mode:


* HP-UX 64

* HP-UX Itanium 64

cc +DD64 -c -IRFCSDK/include -DSAPwithUNICODE sapinfo.c

/opt/aCC/bin/aCC +DD64 -LRFCSDK/lib -l:librfcum.sl -l:libsapucum.sl -o
sapinfo sapinfo.o

Run (environment) LD_LIBRARY_PATH=RFCSDK/lib


[...]


--
Markus
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-16-2008, 07:39 PM
Uli Link
 
Posts: n/a
Default Re: Problems with compiling a program on HPUX 11.11

Markus schrieb:

> [...]
>
>> Figure out what type the SAP-RFCSDK libs are, and then adjust build
>> accordingly. Or select the correct libs of the SDK.
>>

>
> SAP RFC-SDK is compiled and linked with HPs aCC compiler, no chance to
> use gcc.


As long as SAP's RFC libs not include C++ it should be possible with GCC
too. What SAP will support is a completely different story.

You can mix *C only* libs between Vendor and GCC compiler.

> cc -DSAPonUNIX -z +DD64 -Ae +w1 -DSAPwithTHREADS -D_REENTRANT
> -D_POSIX_C_SOURCE=199506L -DSAPonHPPA -c sapinfo.c


I can see that the program wants the "-Ae -D_REENTRANT" flags.
So the GCC should be configured and working for Posix threads before.

--
Uli
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:00 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com