Operating System - Linux
1753770 Members
4966 Online
108799 Solutions
New Discussion юеВ

Need +n option for aC++ as linker

 
Kevin Normandy
Occasional Advisor

Need +n option for aC++ as linker

HP_UX 11.00
aC++ A.03.30

Using aCC as linker and I'm getting uresolved externals that are there. I get the same error messages as when I run ld WITHOUT the +n option.

+n Causes the linker to load all object modules before searching any archive or shared libraries. Then it searches the archive and shared libraries specified on the command line in left to right order. Repeats the left to right search of the libraries on the command line until there are no more unsatisfied symbols, or the last search added no new definitions. This option is useful if two libraries are specified that have symbol dependencies on each other.

So I need a +n for aCC or a way for aCC to pass the +n to ld when it calls it.

aCC: warning 901: unknown option: `+n': use +help for online documentation.
aCC: warning 901: unknown option: `-umain': use +help for online documentation.
/usr/ccs/bin/ld: Unsatisfied symbols:
blkvwl (first referenced in /vobs/HP-UX_stage/lib/libxxxlib.a(xxx_iiucom.o)) (code)
mcpexp (first referenced in /vobs/HP-UX_stage/lib/libxxxlib.a(xxx_v1mcpe.o)) (code)

and many many many more.

TIA
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: Need +n option for aC++ as linker

Do a man aCC and have a look at the -Wx,arg1,arg2 option that hands off options to the various stages of the compiler/linker. Of course, you could break your makefile so that a separate link phase is used but

aCC -Wl,+n ... will send the +n option to ld.
If it ain't broke, I can fix that.
Dennis Handly
Acclaimed Contributor

Re: Need +n option for aC++ as linker

Besides using -Wl,+n as Clay says, you can also order your archive libs, or repeat them.