1
General discussions / error LNK2001 ...
« on: May 04, 2008, 01:11:57 pm »
You have created a Windows Application project, therefor - linker is expecting WinMain function to be defined. It's an entry point.
From your code, it is clear, that what you wanted was a Console Application project, so that linker would know that the function "main" is the entry point function.
You can change this setting in project properties (right-click on the project in solution explorer, choose properties). Now, on the left side, choose "Configuration properties -> Linker -> System" and on the right side, set SubSystem to "Console (/SUBSYSTEM:CONSOLE)".
From your code, it is clear, that what you wanted was a Console Application project, so that linker would know that the function "main" is the entry point function.
You can change this setting in project properties (right-click on the project in solution explorer, choose properties). Now, on the left side, choose "Configuration properties -> Linker -> System" and on the right side, set SubSystem to "Console (/SUBSYSTEM:CONSOLE)".