error LNK2019: unresolved external symbol _WinMain@16 referenced in function
I use SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE TRUE) in cmakelists.txt but get above error.Help me...Thank in advance!
error LNK2019: unresolved external symbol _WinMain@16 referenced in function
I use SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE TRUE) in cmakelists.txt but get above error.Help me...Thank in advance!
WinMain is a windows function right? so you would have to include windows.h or use int main() instead.
error occur only when I use SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE TRUE) in cmakelists.txt.If I remove this command then result is OK.Why is cannot set properties of target?
Qt projects don't use WinMain as far as I'm aware. You don't need that flag anyway, you can just use the linker flag "/SUBSYSTEM:WINDOWS".
Bookmarks