代码:
#ifndef H_PLASEX_H
#define H_PLASEX_H
#include
#include
/**
- One day, the base of all exceptions in plasimo.
/
struct plException : public exception //提示出错
{
/// The error message.
std::string err;
/// A convenience to reduce keyboard wear.
typedef plException PE;
/// Compatibility with the standard exception type.
const char * what() const { return err.c_str(); };
/* Constructs a plException object.- \param e
- The error message.
- \param cse
- The exception that caused this one. If not \a 0, its \a err field
- will be appended to that of the constructed object.
*/
plException( const std::string & e, const plException *cse=0 ) :
err( cse==0 ? e : e+std::string("\n caused by ")+cse->err ) {}
};
#endif
错误信息:plasex.h:11:1: error: expected class-name before ‘{’ token
查了很长世间,都说问题在头文件,但是#include不是标准库里边的吗?这个怎么会出错,这种错误该怎么解决?求大神解答(平台:ubuntu)