I tried to compile a simple win32 API program. And for some reason that I can't seem to get fixed, I get a compilation error in the Clion IDE which I usually use for coding. But the same code run perfectly fine with the visual studio IDE. Now I really want to fix that problem so I can understand a little bit more of how things work in the background and also because I don't want to get use to a different IDE from what I already use to. The code is the example from here: https://learn.microsoft.com/en-us/windows/win32/learnwin32/your-first-windows-program
I didn't try anything actually due to the fact I couldn't find any sort of help on the web for my problem.
this is the errors I get:
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): In function `main':
C:/crossdev/src/mingw-w64-v4-git/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
CMakeFiles\untitled4.dir\build.make:84: recipe for target 'untitled4.exe' failed
mingw32-make.exe[3]: *** [untitled4.exe] Error 1
mingw32-make.exe[2]: *** [CMakeFiles/untitled4.dir/all] Error 2
CMakeFiles\Makefile2:71: recipe for target 'CMakeFiles/untitled4.dir/all' failed
CMakeFiles\Makefile2:83: recipe for target 'CMakeFiles/untitled4.dir/rule' failed
mingw32-make.exe[1]: *** [CMakeFiles/untitled4.dir/rule] Error 2
Makefile:117: recipe for target 'untitled4' failed
mingw32-make.exe: *** [untitled4] Error 2