C++ ERROR redefinition of ‘class ***’
2015-12-14 16:26
459 查看
转载自:http://blog.csdn.net/longshengguoji/article/details/8307400
报错如下:
BaseSmoothingAlgorithm.h:4:7: error: redefinition of ‘class BaseSmoothingAlgorithm’
BaseSmoothingAlgorithm.h:4:7: error: previous definition of ‘class BaseSmoothingAlgorithm’
排错步骤:
1.查找类的定义后面是否少类“;”;一一查找后发现有,不是该类型的错误
2.少了防止被多次包含的宏,果真如此,修改如下
#ifndef _BASESMOOTHINGALGORITHM_H_
#define _BASESMOOTHINGALGORITHM_H_
#include "BaseSmoothingAlgorithm.h"
#endif
解决
报错如下:
BaseSmoothingAlgorithm.h:4:7: error: redefinition of ‘class BaseSmoothingAlgorithm’
BaseSmoothingAlgorithm.h:4:7: error: previous definition of ‘class BaseSmoothingAlgorithm’
排错步骤:
1.查找类的定义后面是否少类“;”;一一查找后发现有,不是该类型的错误
2.少了防止被多次包含的宏,果真如此,修改如下
#ifndef _BASESMOOTHINGALGORITHM_H_
#define _BASESMOOTHINGALGORITHM_H_
#include "BaseSmoothingAlgorithm.h"
#endif
解决
相关文章推荐
- C++学习笔记10-面向对象
- C语言学习笔记之void
- C语言中整型溢出的危害
- 目标文件里有什么
- 编译和链接
- C++学习笔记(初级篇)——Lambda表达式
- c++ 常见手误
- C语言之转义字符
- 支持c++11-gcc4.8的安装与升级
- 【C++】静态成员函数小结
- C/C++中typedef 用法
- C++容易忽略的细节
- C++容易忽略的输入输出特性
- C语言函数指针的用法
- C语言中的回调函数实例
- hdu 2177 取(2堆)石子游戏(威佐夫博奕(Wythoff Game))
- C++中 vector、list、deque、set、map的底层实现
- C++STL库的Vector容器简单实现的源代码参考
- C++ 文件操作(不断更新ing)
- GDI图片分割(C++)