[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] g++ problem with archives & linking



There's a problem with g++ and archives.

Try this very simple program and save it as main.c

main()
{
}

Now compile with...

m68k-atari-mint-g++ -c main.c

Now, create an archive with it...

m68k-atari-mint-ar rv libtest.a main.o

Now, try and create a program...

m68k-atari-mint-g++ -o main libtest.a

It fails with.....

/usr/lib/gcc/m68k-atari-mint/4.2.3/../../../../m68k-atari-mint/lib/libc.a(main.o):main.o:(.text+0x318): undefined reference to `_main'
/usr/lib/gcc/m68k-atari-mint/4.2.3/../../../../m68k-atari-mint/lib/libc.a(main.o):main.o:(.text+0x620): undefined reference to `_main'

Whereas if you do this...

m68k-atari-mint-g++ -o main main.o

it works fine.

Any ideas Vincent ??

Alan.