News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Directx Project Template "WinMain" undefined

Started by andrewbowley, October 02, 2023, 08:16:14 AM

Previous topic - Next topic

andrewbowley

This issue is mentioned in prior topic "Using DirectX with Code::Blocks  (Read 36469 times)" https://forums.next.codeblocks.org/index.php/topic,14103.0.html

User  antonien  created a project unsing the Directx template and after solving an initial problem, ran into the linker reporting "Undefined reference to WinMain".
I have just installed Codeblocks from a nightly Windows build and reproduced the issue. The problem is in tile file main.cpp at installed location share\CodeBlocks\templates\wizard\directx\dx9. It declares the application entry point as:

INT WINAPI wWinMain( HINSTANCE hInst, HINSTANCE, LPWSTR, INT )

A directx_main.cpp in the templates parent directory has the correct name for this function, which is "WinMain". I am not familiar with how project templates work, but I am confident that replacing the buggy main.cpp witn directx_main.cpp will fix the problem.

Build: svn build  rev 13360 (2023-09-24 17:25:53)   gcc 13.1.0 Windows/unicode - 64 bit
OS: Windows 8.1
DX SDK June 2010