Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PC:/mnt/c/Users/Tom/Desktop/Anti-Shop-Exploits-v2$ g++ -std=c++17 main.cpp -lstdc++fs
- main.cpp: In function ‘int main()’:
- main.cpp:34:61: error: binding reference of type ‘std::filesystem::__cxx11::directory_entry&’ to ‘const std::filesystem::__cxx11::directory_entry’ discards qualifiers
- 34 | for (fs::directory_entry &elem : fs::directory_iterator()) {
- | ^
- main.cpp:37:34: error: no matching function for call to ‘std::basic_ifstream<char>::basic_ifstream(std::filesystem::__cxx11::directory_entry&)’
- 37 | std::ifstream inFile(elem);
- | ^
- In file included from main.cpp:19:
- /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>]’
- 587 | basic_ifstream(basic_ifstream&& __rhs)
- | ^~~~~~~~~~~~~~
- /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>&&’
- 587 | basic_ifstream(basic_ifstream&& __rhs)
- | ~~~~~~~~~~~~~~~~~^~~~~
- /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)’
- 579 | basic_ifstream(const _Path& __s,
- | ^~~~~~~~~~~~~~
- /usr/include/c++/9/fstream:579:2: note: template argument deduction/substitution failed:
- /usr/include/c++/9/fstream:578:32: error: ‘class std::filesystem::__cxx11::directory_entry’ has no member named ‘make_preferred’
- 578 | template<typename _Path, typename _Require = _If_fs_path<_Path>>
- | ^~~~~~~~
- /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]’
- 562 | basic_ifstream(const std::string& __s,
- | ^~~~~~~~~~~~~~
- /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>&’}
- 562 | basic_ifstream(const std::string& __s,
- | ~~~~~~~~~~~~~~~~~~~^~~
- /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]’
- 529 | basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
- | ^~~~~~~~~~~~~~
- /usr/include/c++/9/fstream:529:34: note: no known conversion for argument 1 from ‘std::filesystem::__cxx11::directory_entry’ to ‘const char*’
- 529 | basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
- | ~~~~~~~~~~~~^~~
- /usr/include/c++/9/fstream:518:7: note: candidate: ‘std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits<char>]’
- 518 | basic_ifstream() : __istream_type(), _M_filebuf()
- | ^~~~~~~~~~~~~~
- /usr/include/c++/9/fstream:518:7: note: candidate expects 0 arguments, 1 provided
- main.cpp:38:25: error: no matching function for call to ‘std::basic_ifstream<char>::open(std::filesystem::__cxx11::directory_entry&)’
- 38 | inFile.open(elem);
- | ^
- In file included from main.cpp:19:
- /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]’
- 658 | open(const char* __s, ios_base::openmode __mode = ios_base::in)
- | ^~~~
- /usr/include/c++/9/fstream:658:24: note: no known conversion for argument 1 from ‘std::filesystem::__cxx11::directory_entry’ to ‘const char*’
- 658 | open(const char* __s, ios_base::openmode __mode = ios_base::in)
- | ~~~~~~~~~~~~^~~
- /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]’
- 697 | open(const std::string& __s, ios_base::openmode __mode = ios_base::in)
- | ^~~~
- /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>&’}
- 697 | open(const std::string& __s, ios_base::openmode __mode = ios_base::in)
- | ~~~~~~~~~~~~~~~~~~~^~~
- /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>]’
- 718 | open(const _Path& __s, ios_base::openmode __mode = ios_base::in)
- | ^~~~
- /usr/include/c++/9/fstream:718:2: note: template argument deduction/substitution failed:
- /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]’:
- main.cpp:38:25: required from here
- /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