이 문제를 조사한 결과 문제가있는 곳을 보지 못했습니다. 나는 C++의 전문가가 아니기 때문에 나에게 이것은 괜찮아 보인다. 이것은 내가 마지막으로 시도했을 때 문제없이 컴파일하는 데 사용되었습니다. 오버 라이딩 오류 ... Lax ... C++ 언어 스펙 위반 일 수 있습니까?
namespace yaaf {
/************************************************************************/
/* */
/* Standard YAAF Errors */
/* */
/************************************************************************/
/* XGYAAFError
*
* YAAF Error; this is the root of my YAAF errors, and is
* a descendant of the standard exception class
*/
class XGYAAFError : public std::exception {
public:
explicit XGYAAFError(const char *);
explicit XGYAAFError(const std::string &err);
const char *what() const throw()
{
return fError.c_str();
}
private:
std::string fError;
};
} // namespace yaaf
#endif
GCC는 라이브러리 기본 클래스
.../**
* @brief Base class for all library exceptions.
*
* This is the base class for all exceptions thrown by the standard
* library, and by certain language expressions. You are free to derive
* your own %exception classes, or use a different hierarchy, or to
* throw non-class data (e.g., fundamental types).
*/
class exception
{
public:
exception() throw() { }
virtual ~exception() throw();
/** Returns a C-style character string describing the general cause
* of the current error. */
virtual const char* what() const throw();
};
오류 "최우선 기능의 사양은 기본 버전보다 더 느슨하다"나는 빌드 할 때 내가 지금 무엇을 얻을 수 있습니다.
이 생각은 C++ 언어의 변경 (약 2004 ??) 및 파생 클래스 내에서 포인터를 선언 할 수있는 곳과 관련이 있다고 생각합니다. 그러나 나는 그것이 그 경우에 해당하는지 그리고 이것을 고치는 방법에 대해 확신하지 못합니다.
구체적으로 무엇이 잘못되었거나 어떻게 해결할 수 있는지에 대한 아이디어는 높이 평가됩니다.
감사
질문의 형식을 올바르게 지정하십시오. –