Operating System - HP-UX
1753797 Members
7309 Online
108805 Solutions
New Discussion юеВ

Error while compilaton in HP-UX11.11

 
SOLVED
Go to solution
Anand_30
Regular Advisor

Error while compilaton in HP-UX11.11

HI all,

I am getting the following error while compiling my code in HP-UX11.11:
/usr/ccs/bin/ld: Unrecognized argument: +init
/usr/ccs/bin/ld: Usage: /usr/ccs/bin/ld [options] [flags] files
collect2: ld returned 1 exit status
Can anyone please help me find a solution for this problem.

-Anand.
5 REPLIES 5
Mike Stroyan
Honored Contributor

Re: Error while compilaton in HP-UX11.11

It sounds like you are using 32-bit mode. That did not originally support +init.
You could switch to +I initializers as discussed in
http://docs.hp.com/cgi-bin/onlinedocs.py?mpn=B2355-90655&service=hpux&path=00/00/54

Or you could get a newer linker such as patch PHSS_28871.
Anand_30
Regular Advisor

Re: Error while compilaton in HP-UX11.11

Thanks Mike,

I am using 32-bit mode and the gcc version 3.3.1. I did not get this kind of error while compiling other codes but when I tried compiling a C++ code using the c++ which comes alone with gcc-3.3.1, I got this error.
Will installing the new linker patch, help me solve this problem. Is there any other ways in which I can get around this problem.

-Anand.
Mike Stroyan
Honored Contributor
Solution

Re: Error while compilaton in HP-UX11.11

The +init feature first appeared in the 32-bit HP-UX ld in March of 2001. A current linker patch should prevent the error message.
Anand_30
Regular Advisor

Re: Error while compilaton in HP-UX11.11

Thanks Mike,

I would install the current linker patch and try the compile again

-Anand.

leonardo_20
Valued Contributor

Re: Error while compilaton in HP-UX11.11

Hi Anann,
the following code error happened while compiling with g++ 3.3.1 on HPUX-11.00.
It happened when inserting an STL include on source code main.
I have a single source code to compile, main.c, with the following makefile line:
g++ main.cpp -L/usr/lib -L/usr/local/lib -L/usr/local/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.3.1 -I/usr/include/ -I/usr/local/include -I/usr/local/include/c++/3.3.1 -o demo -lstdc++

The error code follow:
/usr/ccs/bin/ld: Unrecognized argument: +init
/usr/ccs/bin/ld: Usage: /usr/ccs/bin/ld flags... files...
collect2: ld returned 1 exit status
*** Error exit code 1

Stop.


Can you help me to resolve that problem ?
I saw you have encountered that
Leonardo Roberto
leorob@hotmail.com