visual studio linker errors solution

来源:互联网 发布:网络暴力事例袁姗姗 编辑:程序博客网 时间:2024/05/17 20:00

Explanation of the ILLUSION.int main(int argc, char *argv[]) You probably need to set Project->properties->linker->system->subsystem to CONSOLEIf 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 WINDOWSTHE ERRORs if you SET subsystem to CONSOLE is:MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartupOR THE ERROR if you SET subsystem to WINDOWS is:MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartupThe 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 mainCtl-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.

原创粉丝点击