error C2143: syntax error : missing ';' before 'PCH creation point'
来源:互联网 发布:南京华通科技 知乎 编辑:程序博客网 时间:2024/06/07 06:07
今天开始 用 slickedit ,但是第一个cpp就执行不成功,难道是不支持C++??好像不太可能,无奈,只能拿到VC下进行验证
结果还是报错:
Config.h
#ifndef _CONFIG_H
#define _CONFIG_H
#include <string>
#include <fstream>
#include "modem.h"
#include "MacroDefine.h"
#define DEFALTRCCONFIGFILEPATH "/config/config.conf"
using namespace std;
class Cconfig{
public:
Cconfig();
char filename[128];
ifstream fs;
}
#endif
Config.cpp
CConfig::CConfig()
{
strcpy(filename,DEFALTRCCONFIGFILEPATH);
}
结果报错:
ompiling...
config.cpp
d: /study/tt/config.cpp(1) : error C2143: syntax error : missing ';' before 'PCH creation point'
执行 cl.exe 时出错.
config.exe - 1 error(s), 0 warning(s)
后来发现是类定义后头少了个分号,加上,ok
一般这类错误都是包含的头文件中 缺少分号或者有什么语法错误之类的。
简单的修改方法就是:根据提示缺少分号,在.h中末尾添加分号,然后错误就转移到.h中了,
呵呵。
- error C2143: syntax error : missing ';' before 'PCH creation point'
- error C2143: syntax error : missing ';' before 'PCH creation point'
- error C2143: syntax error : missing ';' before '*'问题
- error C2143: syntax error : missing ';' before '*....
- error C2143: syntax error : missing ';' before '*.... 解决...
- error C2143: syntax error : missing ')' before '*'
- error C2143: syntax error : missing ';' before '*'
- error C2143: syntax error : missing ';' before 'type'
- error C2143: syntax error : missing ';' before 'type'
- error C2143: syntax error : missing ';' before 'type'
- error C2143: syntax error : missing ';' before 'type'
- error C2143: syntax error : missing ';' before '.'
- error C2143: syntax error : missing ';' before '*.... 解决方案
- error C2143: syntax error : missing \';\' before \'type\'
- error C2143: syntax error : missing ';' before 'type'
- error C2143: syntax error : missing ';' before '}'
- error C2143:syntax error :missing ‘;’before ‘}’
- error C2143: syntax error : missing ';' before 'namespace'
- 心情不好,随便写写,别人让你心情不好,说明你修行还不够。呵呵。
- What's Calendar?
- Scripting language
- [教程] PSP 5.00M33-6升级图文教程
- 000000000000
- error C2143: syntax error : missing ';' before 'PCH creation point'
- Linux操作系统中,重启/关闭Weblogic服务器的方法
- 罐装红酒的开拓者——智利菲尔帝进军中国市场
- 日期型数匹配查询(%)
- SqlHelper详解
- In the end, it's these small things that you remember.
- 拇指文化勃兴 "城外"开中国手机小说之先河
- Struts2与Struts1的区别
- Winform中通过WebService调用session