现在的位置: 首页 > 综合 > 正文

VC错误处理解决汇总

2018年03月16日 ⁄ 综合 ⁄ 共 689字 ⁄ 字号 评论关闭

在使用VC过程中经常由于工程设置问题使程序编译或者链接通不过,有时候上网搜一下可以解决,有时候搜却要费很长时间,因此决定把每次遇到问题汇总起来,解决一个汇总一个,便于以后错误重现时处理。

1、链接错误:error LNK2001: unresolved external symbol __imp___mbscmp

Q. I got the error [error LNK2001: unresolved external symbol __imp___mbscmp] what can I do ?

A. Go to menu Project -> Setting choose the C/C++ tab and in the field Preprocessor definitions remove the _MBCS definition

2、连接错误

error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >

这里主要涉及到C++静态变量赋值问题,在C++类中有一个静态成员变量,在静态成员函数对其进行赋值时,应该现在CPP文件中做下声明

如下:

 string MeasureTime::sTitle ;

在静态函数中就可以这样赋值了

MeasureTime::sTitle=sTitle ;

3、编译错误:error C2143: syntax error : missing ';' before 'PCH creation point'

这个一般是头文件中在某处少个分号;

抱歉!评论已关闭.