Próbuję skompilować to z g ++ pod Ubuntu:kompilacji błąd podczas próby dziedziczą std :: runtime_error
#ifndef PARSEEXCEPTION_H
#define PARSEEXCEPTION_H
#include<exception>
#include<string>
#include<iostream>
struct ParseException : public std::runtime_error
{
explicit ParseException(const std::string& msg):std::runtime_error(msg){};
explicit ParseException(const std::string& token,const std::string& found):std::runtime_error("missing '"+token+"',instead found: '"+found+"'"){};
};
#endif
otrzymuję błędów wiadomość:
In file included from parseexception.cpp:1:
parseexception.h:9: error: expected class-name before ‘{’ token
parseexception.h: In constructor ‘ParseException::ParseException(const std::string&)’:
parseexception.h:10: error: expected class-name before ‘(’ token
parseexception.h:10: error: expected ‘{’ before ‘(’ token
parseexception.h: In constructor ‘ParseException::ParseException(const std::string&, const std::string&)’:
parseexception.h:11: error: expected class-name before ‘(’ token
parseexception.h:11: error: expected ‘{’ before ‘(’ token
enter code here
mam Miałem ten problem od jakiegoś czasu i nie mogę naprawdę powiedzieć, co jest z nim nie tak:/
dzięki dużo Nikko: D – SlimJim
+1 za ojcowską radę :) – Chani