Ben Ubuntu altında g ++ ile bu derlemek çalışıyorum: Benderleme hatası :: runtime_error
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
:
#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
hata-mesajı alıyorum Bu sorun şu anda bir süredir vardı ve ben bununla yanlış bir şey göremiyorum:/
sağolsun Nikko: D – SlimJim
+1 Baba tavsiyesi için :) – Chani