Guest User

Untitled

a guest
Jun 21st, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. #include <stdexcept>
  2. #include <string>
  3.  
  4. class SocketException : public std::runtime_error {
  5. public:
  6. SocketException(const std::string& message)
  7. : std::runtime_error(message)
  8. { }
  9. };
  10.  
  11. class FileNotFoundException : public std::runtime_error {
  12. public:
  13. FileNotFoundException(const std::string& filename)
  14. : std::runtime_error("File not found")
  15. {
  16. _filename = filename;
  17. }
  18.  
  19. std::string filename()
  20. {
  21. return _filename;
  22. }
  23.  
  24. protected:
  25. std::string _filename;
  26. };
  27.  
  28.  
  29.  
  30. shax@cl-297:~/katana$ make
  31. g++ -I /usr/src/boost_1_39_0 -L/usr/src/boost_1_39_0/stage/lib/ -lboost_system-gcc43-mt -lboost_thread-gcc43-mt main.cpp katana.cpp poll_manager.cpp -o katana
  32. In file included from system_manager.hpp:7,
  33. from katana.hpp:6,
  34. from main.cpp:1:
  35. exceptions.hpp:11: error: looser throw specifier for âvirtual FileNotFoundException::~FileNotFoundException()â
  36. /usr/include/c++/4.3/stdexcept:117: error: overriding âvirtual std::runtime_error::~runtime_error() throw ()â
  37. In file included from katana.hpp:6,
  38. from main.cpp:1:
  39. system_manager.hpp:13: error: expected `:' before âsize_tâ
  40. In file included from system_manager.hpp:7,
  41. from katana.hpp:6,
  42. from katana.cpp:1:
  43. exceptions.hpp:11: error: looser throw specifier for âvirtual FileNotFoundException::~FileNotFoundException()â
  44. /usr/include/c++/4.3/stdexcept:117: error: overriding âvirtual std::runtime_error::~runtime_error() throw ()â
  45. In file included from katana.hpp:6,
  46. from katana.cpp:1:
  47. system_manager.hpp:13: error: expected `:' before âsize_tâ
  48. In file included from poll_manager.hpp:8,
  49. from poll_manager.cpp:1:
  50. exceptions.hpp:11: error: looser throw specifier for âvirtual FileNotFoundException::~FileNotFoundException()â
  51. /usr/include/c++/4.3/stdexcept:117: error: overriding âvirtual std::runtime_error::~runtime_error() throw ()â
  52. make: *** [katana] Error 1
  53. shax@cl-297:~/katana$
Add Comment
Please, Sign In to add comment