Advertisement
Guest User

Untitled

a guest
May 2nd, 2020
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.98 KB | None | 0 0
  1. PC:/mnt/c/Users/Tom/Desktop/Anti-Shop-Exploits-v2$ g++ -std=c++17 main.cpp -lstdc++fs
  2. main.cpp: In function ‘int main():
  3. main.cpp:34:61: error: binding reference of type ‘std::filesystem::__cxx11::directory_entry&’ to ‘const std::filesystem::__cxx11::directory_entry’ discards qualifiers
  4.    34 |     for (fs::directory_entry &elem : fs::directory_iterator()) {
  5.       |                                                             ^
  6. main.cpp:37:34: error: no matching function for call to ‘std::basic_ifstream<char>::basic_ifstream(std::filesystem::__cxx11::directory_entry&)
  7.    37 |         std::ifstream inFile(elem);
  8.       |                                  ^
  9. In file included from main.cpp:19:
  10. /usr/include/c++/9/fstream:587:7: note: candidate: ‘std::basic_ifstream<_CharT, _Traits>::basic_ifstream(std::basic_ifstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]
  11.   587 |       basic_ifstream(basic_ifstream&& __rhs)
  12.       |       ^~~~~~~~~~~~~~
  13. /usr/include/c++/9/fstream:587:39: note:   no known conversion for argument 1 from ‘std::filesystem::__cxx11::directory_entry’ to ‘std::basic_ifstream<char>&&
  14.   587 |       basic_ifstream(basic_ifstream&& __rhs)
  15.       |                      ~~~~~~~~~~~~~~~~~^~~~~
  16. /usr/include/c++/9/fstream:579:2: note: candidate:template<class _Path, class _Require> std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const _Path&, std::ios_base::openmode)
  17.   579 |  basic_ifstream(const _Path& __s,
  18.       |  ^~~~~~~~~~~~~~
  19. /usr/include/c++/9/fstream:579:2: note:   template argument deduction/substitution failed:
  20. /usr/include/c++/9/fstream:578:32: error:class std::filesystem::__cxx11::directory_entry’ has no member named ‘make_preferred’
  21.   578 |       template<typename _Path, typename _Require = _If_fs_path<_Path>>
  22.       |                                ^~~~~~~~
  23. /usr/include/c++/9/fstream:562:7: note: candidate: ‘std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::__cxx11::basic_string<char>; std::ios_base::openmode = std::_Ios_Openmode]
  24.   562 |       basic_ifstream(const std::string& __s,
  25.       |       ^~~~~~~~~~~~~~
  26. /usr/include/c++/9/fstream:562:41: note:   no known conversion for argument 1 from ‘std::filesystem::__cxx11::directory_entry’ to ‘const string&{aka ‘const std::__cxx11::basic_string<char>&}
  27.   562 |       basic_ifstream(const std::string& __s,
  28.       |                      ~~~~~~~~~~~~~~~~~~~^~~
  29. /usr/include/c++/9/fstream:529:7: note: candidate: ‘std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
  30.   529 |       basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
  31.       |       ^~~~~~~~~~~~~~
  32. /usr/include/c++/9/fstream:529:34: note:   no known conversion for argument 1 from ‘std::filesystem::__cxx11::directory_entry’ to ‘const char*
  33.   529 |       basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
  34.       |                      ~~~~~~~~~~~~^~~
  35. /usr/include/c++/9/fstream:518:7: note: candidate: ‘std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits<char>]
  36.   518 |       basic_ifstream() : __istream_type(), _M_filebuf()
  37.       |       ^~~~~~~~~~~~~~
  38. /usr/include/c++/9/fstream:518:7: note:   candidate expects 0 arguments, 1 provided
  39. main.cpp:38:25: error: no matching function for call to ‘std::basic_ifstream<char>::open(std::filesystem::__cxx11::directory_entry&)
  40.    38 |         inFile.open(elem);
  41.       |                         ^
  42. In file included from main.cpp:19:
  43. /usr/include/c++/9/fstream:658:7: note: candidate:void std::basic_ifstream<_CharT, _Traits>::open(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
  44.   658 |       open(const char* __s, ios_base::openmode __mode = ios_base::in)
  45.       |       ^~~~
  46. /usr/include/c++/9/fstream:658:24: note:   no known conversion for argument 1 from ‘std::filesystem::__cxx11::directory_entry’ to ‘const char*
  47.   658 |       open(const char* __s, ios_base::openmode __mode = ios_base::in)
  48.       |            ~~~~~~~~~~~~^~~
  49. /usr/include/c++/9/fstream:697:7: note: candidate:void std::basic_ifstream<_CharT, _Traits>::open(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::__cxx11::basic_string<char>; std::ios_base::openmode = std::_Ios_Openmode]
  50.   697 |       open(const std::string& __s, ios_base::openmode __mode = ios_base::in)
  51.       |       ^~~~
  52. /usr/include/c++/9/fstream:697:31: note:   no known conversion for argument 1 from ‘std::filesystem::__cxx11::directory_entry’ to ‘const string&{aka ‘const std::__cxx11::basic_string<char>&}
  53.   697 |       open(const std::string& __s, ios_base::openmode __mode = ios_base::in)
  54.       |            ~~~~~~~~~~~~~~~~~~~^~~
  55. /usr/include/c++/9/fstream:718:2: note: candidate:template<class _Path> std::_If_fs_path<_Path, void> std::basic_ifstream<_CharT, _Traits>::open(const _Path&, std::ios_base::openmode) [with _Path = _Path; _CharT = char; _Traits = std::char_traits<char>]
  56.   718 |  open(const _Path& __s, ios_base::openmode __mode = ios_base::in)
  57.       |  ^~~~
  58. /usr/include/c++/9/fstream:718:2: note:   template argument deduction/substitution failed:
  59. /usr/include/c++/9/fstream: In substitution of ‘template<class _Path> std::_If_fs_path<_Path, void, decltype (declval<_Path&>().make_preferred().filename())> std::basic_ifstream<char>::open<_Path>(const _Path&, std::ios_base::openmode) [with _Path = std::filesystem::__cxx11::directory_entry]:
  60. main.cpp:38:25:   required from here
  61. /usr/include/c++/9/fstream:718:2: error:class std::filesystem::__cxx11::directory_entry’ has no member named ‘make_preferred’
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement