实际异常一:
libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __CrtDbgReport
Debug/B机.exe : fatal error LNK1120: 1 unresolved externals
处理办法:
property pages->Configuration Propertyies->C/C++->Code Generation->Runtime Library->Multi-threaded Debug(/MTd)
实际异常二:
Error 30 error C3861: 'CryptReleaseContext': identifier not found c:\users\administrator\desktop\mywin32http-dll\common\include\stringprocess.h 472 1 MyWin32Http-dll
处理方法:
#define _WIN32_WINNT 0x0502
实际异常三:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
处理方法:
project->BaseClasses properties->configuration->C/C++ ->Command Line,增加/wd4430选项。
实际异常四:
中文乱码,单字节字符(vc6)、Unicode(vc8 vc9 vc10)
处理方法:
property pages->Configuration Propertyies->General->Character Set->Use Multi-Byte Character Set
实际异常五:
VC++ 2008编译错误fatal error C1902问题的解决
处理方法:
将C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\mspdbsrv.exe复制到C:\Program Files\Microsoft Visual Studio 9.0\VC\bin下即可。
实际异常六 :
error LNK2019: unresolved external symbol wWinMain referenced in function wWinMainCRTStartup
处理方法:
1.Linker->Advanced页,将Entry Point由wWinMainCRTStartup改成WinMainCRTStartup
2.Configuration Properties->C/C++->Preprocessor,然后在右边栏的Preprocessor Definitions对应的项中删除_CONSOLE, 添加_WINDOWS.
3.Configuration Properties->Linker->System,然后在右边栏的SubSystem对应的项改为Windows(/SUBSYSTEM:WINDOWS)
实际异常七:
处理方法:
在stdafx.h文件最上面加入#define _USE_32BIT_TIME_T
实际异常八:
Run-Time Check Failure #2 - Stack around the variable 'dect' was corrupted.
处理方法:
C/C++->Code Generation->Basic Runtime Checks=Default
实际异常九:
vc2005及以上和6.0的DLL导出函数中有wchar_t, 都无法被对方使用, 必须在vc2005及以上版本中做如下设置
处理方法:
C/C++-->Language->Treat wchar_t as Built-in Type --> No (/Zc:wchar_t-)
实际异常十:
Error 2 error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0500. Value 0x0501 or higher is recommended. c:\program files\microsoft visual studio 10.0\vc\atlmfc\include\afxcomctl32.h 23 1 XPFace
处理方法
#ifndef WINVER 0x0500
#define _WIN32_WINNT 0x0500
#endif
实际异常十一:
afximpl.h中MENUGETOBJECTINFO、HRAWINPUT找不到而出错。
处理方法:
typedef struct tagMENUGETOBJECTINFO {
DWORD dwFlags;
UINT uPos;
HMENU hmenu;
PVOID riid;
PVOID pvObj;
} MENUGETOBJECTINFO, *PMENUGETOBJECTINFO;
typedef struct HRAWINPUT__ * HRAWINPUT;
实际异常十二:
Error 125 error LNK1104: cannot open file 'LIBC.lib' C:\test\LINK test
处理方法:
Configuration Properties->Linker->Input->Ignore Specific Default Libraries=libc.lib