|
From: Mark E. <ma...@eg...> - 2003-05-19 16:59:34
|
Hi.
Is it possible to name your main-procedure other than main() ?
I thought providing a different entry point to the linker would work,
but if I try the following:
// t.cpp
extern "C"
{
int main2()
{
return 0;
}
}
$ g++ t.cpp -c
$ g++ -Wl,-e,_main2 t.o -o t.exe
c:/programme/mingw/bin/../lib/gcc-lib/mingw32/3.2.3/../../../libmingw32.a(main.o)(.text+0x97):main.c:
undefined reference to `WinMain@16'
It's still looking for a WinMain which is obviously referenced from
libmingw32.a(main.c)?!
I added an empty main() and it works.
But that's no solution for me, cause I can't have a main() (clashes
with other main()s in other files).
Even if that would be acceptable, bringing in <iostream> causes the
programm to abort with a memory fault.
Any idea?
Thanks for your time!
mic
|