【error C2143】
1
|
error C2143: 语法错误 : 缺少“;”(在“类型”的前面)
|
原因:以“编译为 C 代码(/TC)”方式编译时,没有把变量定义在函数开始的位置。
【error LNK2019】
1
|
error LNK2019: 无法解析的外部符号 _abc,该符号在函数 _xyz 中被引用
|
原因:
当前源文件 xyz 中使用了外部符号 abc ,但是无法找到该符号,原因是没有包含对应的 .lib 库文件。
另外可能的原因:
- 包含了 .lib 库但是没有将相应的符号 abc 导出
- 还有一种情况是由于头文件和库文件不匹配造成
【error C2733】
1
|
error C2733: second C linkage of overloaded function
'wmemchr'
not allowed
|
原因:针对处于 C++ 模式下的 VC6 以及其它 VS 版本,当进行 ARM 相关编译时应该对要使用的 <wchar.h> 头文件进行 'extern "C++" {}' 处理。
1
2
3
4
5
6
7
8
9
|
#ifdef __cplusplus
extern
"C"
{
#endif
# include <wchar.h>
#ifdef __cplusplus
}
#endif
|
【error C2440】
1
|
error C2440: “=”: 无法从“void *”转换为“void **”
|
原因:一般会在调用 malloc 函数后将其返回值赋值给其他变量时出现,值得注意的是,出现该错误的前提是按照“编译为 C++ 代码 (/TP)”进行编译,如果按照“编译为 C 代码 (/TC)”进行编译则不会出现该错误。
【error C2054】
1
|
error C2054: 在“inline”之后应输入“(”
|
【Warning C4251】
1
2
|
warning C4251:
'AClass::m_variable'
: class
'SomeTemplate<T>'
needs
to have dll-interface to be used by clients of class
'AClass'
|
【Warning C4996】
1
|
warning C4996:
'strdup'
: The POSIX name
for
this item is deprecated. Instead, use the ISO C++ conformant name: _strdup.
|
1
|
warning C4996:
'sprintf'
: This
function
or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
|
原因:详细原因需要参考MSDN上的官方说明。