[Wine] Re: Porting with winelib - undefined reference to `WinMain'

vitamin wineforum-user at winehq.org
Sat Jun 14 11:04:09 CDT 2008

sm217 wrote:
> Hello!
> I'm trying to port zCPU emulator (http://www.wiremod.com/forum/cpu-tutorials-programs/2956-zcpu-emulator.html) to Linux with winelib. This app is mainly console, but can draw some stuff using SDL. The problem is: compiles fine but when linking I get
> Code:
> /usr/lib/wine/libwinecrt0.a(exe_main.o): In function `main':
> exe_main.c:(.text+0x9d): undefined reference to `WinMain'
> Yes, I've googled but none of found solutions hepled.
> Source at current state can be found here: http://silentman.org.ua/build.tar.gz (I use build.sh for compiling)
> wine-1.0-rc4
> ArchLinux testing(GCC 4.3.1)
> in hope for help...

Are you compiling it as console app (winegcc -mconsole) or gui app?
For console app you need to use main() (or wmain() for unicode). And for gui apps you need to use WinMain().

More information about the wine-users mailing list