I am relatively new to C++ and i use CLion. I have been trying to get the wWinMain entry point to work for hours. i used chatgpt, researched on google, I have done everything I can. No matter what I try, its always this exact error. "undefined reference to WinMain ". I simply pasted the sample code from https://learn.microsoft.com/en-us/windows/win32/learnwin32/your-first-windows-program but it just doesnt work. Many people with the exact same problem on stack overflow said they had to add "-municode" which i did. i did add -municode. I made sure my CMake.txt file was set up well, i restarted my pc, reinstalled my compiler, restarted my pc several times, started all over from scratch, i did everything, really.
I am on windows 11, using CLion, MinGW 64. Apparently its a problem with MinGW? At least thats what the dozens of stackoverflow posts ive been desperately reading say. however, i couldnt find a solution on any of them, neither could chatpgt. at least not one that works. i am not that deep into computers, compilers, linking and everything. simply setting up the library "raylib" and getting it to work was a long battle already. but this one seems impossible to defeat by myself.
Full error code:
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\PROGRA~1\JETBRA~1\CLION2~1.5\bin\mingw\bin\G__~1.EXE -g -mwindows CMakeFiles/CppTests.dir/main.cpp.obj -o CppTests.exe -Wl,--out-implib,libCppTests.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:\Program Files\JetBrains\CLion 2024.1.5\bin\mingw\bin/ld.exe: C:/Program Files/JetBrains/CLion 2024.1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crtexewin.o):crtexewin.c:(.text+0x130): undefined reference to WinMain'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.