Author Topic: Directx Project Template "WinMain" undefined  (Read 5648 times)

Offline andrewbowley

  • Single posting newcomer
  • *
  • Posts: 1
Directx Project Template "WinMain" undefined
« on: October 02, 2023, 08:16:14 am »
This issue is mentioned in prior topic "Using DirectX with Code::Blocks  (Read 36469 times)",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:


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

Offline smithloo

  • Single posting newcomer
  • *
  • Posts: 1
Re: Directx Project Template "WinMain" undefined
« Reply #1 on: January 31, 2024, 05:29:44 pm »
The problem might be from parent directory

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1564
Re: Directx Project Template "WinMain" undefined
« Reply #2 on: January 31, 2024, 05:57:19 pm »
Future spam added to radar.