BladeSystem Forums have moved here
To make BladeSystem information easier to find, we have moved the BladeSystem forums here, to Servers and Operating Systems.
Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

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

Occasional Visitor

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
2 REPLIES
Occasional Visitor

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
Highlighted
Acclaimed Contributor

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.