自定义异总是编译出错解决方法

自定义异总是编译出错
#include <exception>
#include <string>

class wxdir_error:public std::exception
{
public:
explicit wxdir_error (const std::string &s):std::exception(s.c_str()){}
};

class compiler_error:public std::exception
{
public:
explicit compiler_error (const std::string &s):std::exception(s.c_str()){}
};

class building_error:public std::exception
{
public:
explicit building_error (const std::string &s):std::exception(s.c_str()){}
};

为什么VC++就能顺利通过,MinGW总是编译错误?
新手求解
------解决方案--------------------
引用:
也就是说我只需要继承,自己的exception里不需要写任何东西,是吧

写what()吧,必要时可以用来汇报,异常信息。