Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

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

abuthalip
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
abuthalip
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
Dennis Handly
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.