I have a working Visual Studio project that uses wmain() as the entry-point. I would like to use main() instead.
If I simply change the function signature to int main(), I get:
error LNK2019: unresolved external symbol _wmain referenced in function "void __cdecl mainCRTStartupHelper(struct HINSTANCE__ *,unsigned short const *)"
What option do I need to change to make the link succeed?
Configuration Properties > General > Character Set. There are three options:Not Set,Use Unicode Character Set, andUse Multi-Byte Character Set. None of them seem to work. - Brent Bradburnmain,wmainand_tmainwithout touching project settings, and the project builds fine. As a very long shot, do you have anything under Linker > Advanced > Entry Point? - Igor TandetnikEntry Point(I discovered this by creating a project from scratch as you did). With my existing project, I am not able to use an emptyEntry Point(unresolved_WinMain), but at least I have found something that works. --Thanks for the help. - Brent BradburnWinMainvsmain: Linker > System > SubSystem. Change from Windows to Console. You want Entry Point to be empty except in certain highly unusual situations. - Igor Tandetnik