Explanation of the ILLUSION. int main(int argc, char *argv[]) You probably need to set Project->properties->linker->system->subsystem to CONSOLE If you have an INCOMPATIBLE NON STANDARD C++ main; breaking all the standards in the book; such as the Microsoft veriety then set the same subsystem property to WINDOWS THE ERRORs if you SET subsystem to CONSOLE is: MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup OR THE ERROR if you SET subsystem to WINDOWS is: MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup The error means you do not have the main visible to the the linker. But you are editing the file with main or WinMain in the VS Editor, so what is wrong? Visual Studio can be used as a stand alone editor giving you the illusion that the stuff you are editing can and should be compilable. So the solution is simple you failed to add the file you are editing to the project. Right click on solution name->Add->Existing Item->file with main Ctl-shift-B and it compiles Hello World. SOLVED BUT MICROSOFT NEED TO ADD AN INTELLIGENT LOOK AND SEE WHAT THE DEVELOPER HAS IN HIS EDIT SCREENs. USER CONTEXT IS VITAL FOR SMART ERROR MESSAGES - TOTALLY ABSENT IS ANY SMART ERROR MESSAGE IN THE OUTPUT FROM THE COMPILER AND LINKER.
visual studio linker errors solution
最新推荐文章于 2024-09-10 14:06:55 发布