VS2012常见错误及解决方法
2015-05-09 11:53
483 查看
VS2012常见错误及解决方法
1.当建立Win32 Console Application时,程序入口函数是
int main(){} 或者
int _tmain(int argc, _TCHAR*
argv[]){}
正确配置是:
Configuration Properties->C\C++->Preprocessor->PreprocessorDefinitions:
WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
Configuration Properties->Linker->System->SubSystem:
Console (/SUBSYSTEM:CONSOLE)
如果配置不正确,就会出现下面的错误:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Error 1
error LNK2019: unresolved external symbol _WinMain@16referenced in function ___tmainCRTStartup
Error 2
error LNK1120: 1 unresolved externals
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2.当建立Win32 Project时,程序入口函数是
int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPTSTR lpCmdLine,
_In_ int nCmdShow){}
正确配置是:
Configuration Properties->C\C++->Preprocessor->PreprocessorDefinitions:
WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
Configuration Properties->Linker->System->SubSystem:
WINDOWS(/SUBSYSTEM:WINDOWS)
如果配置不正确,就会出现下面的错误:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Error 1
error LNK2019: unresolved external symbol
4000
_main
referenced in function ___tmainCRTStartup
Error 2
error LNK1120: 1 unresolved externals
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3.当建立MFC Applicationt时,程序入口函数是
int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,_In_
LPTSTR lpCmdLine, int nCmdShow){}
正确配置是:
Configuration
Properties->C\C++->Preprocessor->PreprocessorDefinitions:
WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
Configuration Properties->Linker->System->SubSystem:
WINDOWS(/SUBSYSTEM:WINDOWS)
如果配置不正确,就会出现下面的错误:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Error 1
error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
Error 2
error LNK1120: 1 unresolved externals
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1.当建立Win32 Console Application时,程序入口函数是
int main(){} 或者
int _tmain(int argc, _TCHAR*
argv[]){}
正确配置是:
Configuration Properties->C\C++->Preprocessor->PreprocessorDefinitions:
WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
Configuration Properties->Linker->System->SubSystem:
Console (/SUBSYSTEM:CONSOLE)
如果配置不正确,就会出现下面的错误:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Error 1
error LNK2019: unresolved external symbol _WinMain@16referenced in function ___tmainCRTStartup
Error 2
error LNK1120: 1 unresolved externals
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2.当建立Win32 Project时,程序入口函数是
int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPTSTR lpCmdLine,
_In_ int nCmdShow){}
正确配置是:
Configuration Properties->C\C++->Preprocessor->PreprocessorDefinitions:
WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
Configuration Properties->Linker->System->SubSystem:
WINDOWS(/SUBSYSTEM:WINDOWS)
如果配置不正确,就会出现下面的错误:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Error 1
error LNK2019: unresolved external symbol
4000
_main
referenced in function ___tmainCRTStartup
Error 2
error LNK1120: 1 unresolved externals
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3.当建立MFC Applicationt时,程序入口函数是
int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,_In_
LPTSTR lpCmdLine, int nCmdShow){}
正确配置是:
Configuration
Properties->C\C++->Preprocessor->PreprocessorDefinitions:
WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
Configuration Properties->Linker->System->SubSystem:
WINDOWS(/SUBSYSTEM:WINDOWS)
如果配置不正确,就会出现下面的错误:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Error 1
error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
Error 2
error LNK1120: 1 unresolved externals
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
相关文章推荐
- Xcode里常见警告和错误的解决方法
- webservice 常见错误及解决方法
- Linux PC和ARM版的QT环境设置及到ARM移植&常见错误解决方法
- proc文件系统模块编程-常见错误及解决方法
- VS2012 常见错误解决方法
- Maven常见错误及解决方法(一)
- PHP编译过程中常见错误信息的解决方法
- VC6.0常见链接错误与解决方法
- 常见的SQL Server连接失败错误以及解决方法
- windows7下vs2008常见错误解决方法汇总
- Excel常见错误代码及其解决方法
- mysql常见错误提示及解决方法
- Oracle数据库TNS常见错误解决方法(转载)
- 针对上午的"asp.net最常见的错误总结"的问题的解决方法!
- 常见错误:[oracle@nj15 database]$ ./runInstaller解决方法
- CentOS编译PHP5过程中常见错误信息的解决方法
- jack 服务常见错误解决方法
- 常见oracle错误代码ORA-xxxxx及其解决方法(持续更行中)
- mysql常见错误提示及解决方法
- 硬盘的常见错误提示及解决方法