Operating System - HP-UX
1833917 Members
2388 Online
110063 Solutions
New Discussion

Re: gcc __main unsatisfied symbol

 
UNIX System Admins
Occasional Contributor

gcc __main unsatisfied symbol

I am a gcc/ld novice. I have downloaded gcc 3.3.3 binutils and binaries for HPUX 11.i v1 (PA-RISC) from the DSPP web site and installed them both successfully with swinstall.
I also applied patch PHSS_30049.
Now, I am trying to use gcc to link a module with our Oracle Financials Application modules and I am getting this error:

usr/ccs/bin/ld: Unsatisfied symbols:
__main (first referenced in /fp02/oracle/f11tappl/mcm/integration/lib/MCMLJ.o) (code)

From what I have read, libgcc.a should have the definition for __main.

I added the -v option to the gcc command and here is the output:
Reading specs from /usr/local/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.3.3/specs
Configured with: /scratch/zack/pkgbuild/3.3.1/hpux-11/gcc-3.3.3/configure --enable-languages=c,c++ --enable-
threads=posix --disable-nls --with-gnu-as --without-gnu-ld --with-as=/usr/local/bin/as --prefix=/usr/local
Thread model: posix
gcc version 3.3.3
/usr/local/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.3.3/collect2 -z -u main -u __gcc_plt_call -o /fp02/oracle/f1
1tappl/mcm/integration/bin/MCMLJ /usr/lib/crt0.o -L/fp01/app/oracle/product/8.0.6/lib/ -L/usr/local/lib/gcc-
lib/hppa2.0w-hp-hpux11.11/3.3.3 -L/fp01/app/oracle/product/8.0.6/network/jre11/lib/PA_RISC/native_threads -L
. -L/fp01/app/oracle/product/8.0.6/lib -L/usr/lib/Motif2.1 -L/usr/ccs/lib -L/usr/local/lib/gcc-lib/hppa2.0w-
hp-hpux11.11/3.3.3 -L/usr/ccs/bin -L/usr/ccs/lib -L/usr/local/lib -a default +s /fp02/oracle/f11tappl/mcm/in
tegration/lib/MCMLJ.o /fp02/oracle/f11tappl/mcm/integration/lib/libmcm.a /fp02/oracle/f11tappl/fnd/11.5.0/li
b/libfnd.a -lsql /fp01/app/oracle/product/8.0.6/lib/nautab.o /fp01/app/oracle/product/8.0.6/lib/naeet.o /fp0
1/app/oracle/product/8.0.6/lib/naect.o /fp01/app/oracle/product/8.0.6/lib/naedhs.o -lnetv2 -lnttcp -lnetwork
-lncr -lnetv2 -lnttcp -lnetwork -lclient -lvsn -lcommon -lgeneric -lmm -lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4
-lnlsrtl3 -lnetv2 -lnttcp -lnetwork -lncr -lnetv2 -lnttcp -lnetwork -lclient -lvsn -lcommon -lgeneric -lepc
-lnlsrtl3 -lcore4 -lnlsrtl3 -lcore4 -lnlsrtl3 -lclient -lvsn -lcommon -lgeneric -lnlsrtl3 -lcore4 -lnlsrtl3
-lcore4 -lnlsrtl3 -l:libcl.a -l:librt.sl -lpthread -l:libnss_dns.1 -l:libdld.sl -l:libgcc.a -lm /fp01/app/or
acle/product/8.0.6/rdbms/lib/defopt.o /fp01/app/oracle/product/8.0.6/rdbms/lib/ssbbded.o -lgcc -lgcc_eh -lc
-lgcc -lgcc_eh
/usr/ccs/bin/ld: Unsatisfied symbols:
__main (first referenced in /fp02/oracle/f11tappl/mcm/integration/lib/MCMLJ.o) (code)
/usr/ccs/bin/ld: (Warning) Linker features were used that may not be supported in future releases. The +vall
compatwarnings option can be used to display more details, and the ld(1) man page contains additional inform
ation. This warning can be suppressed with the +vnocompatwarnings option.
collect2: ld returned 1 exit status
~

Can anyone help me?
THANKS!
4 REPLIES 4
H.Merijn Brand (procura
Honored Contributor

Re: gcc __main unsatisfied symbol

thanks god that libgcc.a does *_not_* have main :)

try the basics first:


# cat >xx.c
int main (int argc, char *argv[])
{
return (0);
} /* main */
^D
# gcc -o xx xx.c
# ./xx
# echo $?
0

From your comments, I cannot see which object should define main (the program's entry point)

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
UNIX System Admins
Occasional Contributor

Re: gcc __main unsatisfied symbol

Are __main (note the two underbars)and main the same?
H.Merijn Brand (procura
Honored Contributor

Re: gcc __main unsatisfied symbol

yes
Enjoy, Have FUN! H.Merijn
UNIX System Admins
Occasional Contributor

Re: gcc __main unsatisfied symbol

OK, I did as you suggested with no problem - main resolved OK and the object executed, returning a 0. Does this prove the compile part works OK? THANKS!