I have the following program:

int _main (char** args, int args_length1) {
        return 0;
}


int main (int argc, char ** argv) {
        return _main (argv, argc);
}


When compiling & linking this, gcc complains about the _main:

*gcc MainTest.c -o MainTest
/ADFS::HardDisc4.$/Projects/GCC4_/!GCC/bin/../lib/gcc/arm-unknown-riscos/4.1.1/../../../../arm-unknown-riscos/lib/libunixlib.a(unix.o):
 In function `_main':
/home/joty/projects/gccsdk/gccsdk_svn3/gcc4/srcdir/libunixlib/unix/unix.c:358: 
multiple definition of `_main'
/tmp/cc5y9Ik2.o:MainTest.c:(.text+0xc): first defined here
/ADFS::HardDisc4.$/Projects/GCC4_/!GCC/bin/ld: Warning: size of symbol `_main' 
changed from 48 in /tmp/cc5y9Ik2.o to 36 in 
/ADFS::HardDisc4.$/Projects/GCC4_/!GCC/bin/../lib/gcc/arm-unknown-riscos/4.1.1/../../../../arm-unknown-riscos/lib/libunixlib.a(unix.o)
collect2: ld returned 1 exit status

As Vala likes to generate a _main function when compiling a vala
program to a c program, this is a bit impractical. Is there an easy
workaround?

I tried checking the Vala compiler, but it was not immediately
obvious how this name got generated. It might be feasable to go
that way, but I'd like to find out if there is an alternative
solution.

Cheers,
Jan-Jaap

_______________________________________________
GCCSDK mailing list [email protected]
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

Reply via email to