Re: Error : /usr/ccs/bin/ld: Unsatisfied symbols: main (Not referenced yet! Probably due to -u option) (790 Views)
Reply
Occasional Visitor
abuthalip
Posts: 2
Registered: ‎08-17-2010
Message 1 of 3 (790 Views)

Error : /usr/ccs/bin/ld: Unsatisfied symbols: main (Not referenced yet! Probably due to -u option)

Hello all,

I am trying to build a shared library.

/opt/softbench/bin/aCC -c -g -Ae -mt +DAportable -z -fast -DXERCES_NEW_IOSTREAMS -I/opt/java1.4/include -I/opt/java1.4/include/hp-ux TestService.c
/opt/softbench/bin/aCC -g -AA +p -mt +DAportable -z -fast -DXERCES_NEW_IOSTREAMS -I/opt/java1.4/include -I/opt/java1.4/include/hp-ux -o TestService.sl TestService.o

First command executed succesfully and getting the object file generated (TestService.o: PA-RISC1.1 relocatable object)

And, I get the following error after executing the second command:-
/usr/ccs/bin/ld: Unsatisfied symbols:
main (Not referenced yet! Probably due to -u option)
*** Error exit code 1

My Makefile containg the below parameters
------------------------------------------
CCOMP = /opt/softbench/bin/aCC
CCOMPFLAGS = -g -Ae -mt +DAportable -z -fast -DXERCES_NEW_IOSTREAMS

CXXCOMP = /opt/softbench/bin/aCC
CXXCOMPFLAGS = -g -AA +p -mt +DAportable -z -fast -DXERCES_NEW_IOSTREAMS

LDFLAGS = -b +DAportable -Z -z -O
LD = ld ${LDFLAGS}

Machine specifics:-
HP-UX hpsd0803 B.11.11 U 9000/800 (tl)


Kindly suggest.
Thanks,
Abu
Occasional Visitor
abuthalip
Posts: 2
Registered: ‎08-17-2010
Message 2 of 3 (790 Views)

Re: Error : /usr/ccs/bin/ld: Unsatisfied symbols: main (Not referenced yet! Probably due to -u option)

Hi Again,
My program doesn't have any main as i am trying for the JNI programing.

Thanks,
Abu
Acclaimed Contributor
Dennis Handly
Posts: 25,284
Registered: ‎03-06-2006
Message 3 of 3 (790 Views)

Re: Error : /usr/ccs/bin/ld: Unsatisfied symbols: main (Not referenced yet! Probably due to -u option)

>/opt/softbench/bin/aCC

(Why are you using this instead of /opt/aCC?)

>I get the following error after executing the second command:

To create a shlib you need -b.

>LDFLAGS = -b +DAportable -Z -z -O

Why aren't you using this? (Also, you can remove both -Z and -z, they are ignored for shlibs.
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.