I am not even sure how I ended up with two versions of gcc, but I am trying to replace boost with what gcc added into their stuff now. Using their slightly modified example.
en.cppreference.com
gcc8
whating to try and keep this uniformed, where it looks like gcc knows <filesystem> and c++ does not, yet neither work in the end.
what to do?
std::filesystem::recursive_directory_iterator - cppreference.com
Code:
#include <fstream>
#include <iostream>
#include <filesystem>
namespace fs = std::filesystem;
int main()
{
/***
fs::create_directories("sandbox/a/b");
std::ofstream("sandbox/file1.txt");
fs::create_symlink("a", "sandbox/syma");
***/
for(auto& p: fs::recursive_directory_iterator("/media/data1/wallhaven-papers"))
std::cout << p.path() << '\n';
fs::remove_all("/media/data1/wallhaven-papers");
}
Code:
[userx@FreeBSD64ssd test]$ g++9 -std=c++17 main.cpp
[userx@FreeBSD64ssd test]$ ./a.out
ld-elf.so.1: /usr/local/lib/gcc8/libstdc++.so.6: version GLIBCXX_3.4.26 required by /usr/home/userx/test/a.out not found
Code:
[userx@FreeBSD64ssd test]$ c++ -std=c++17 main.cpp
main.cpp:3:10: fatal error: 'filesystem' file not found
#include <filesystem>
^~~~~~~~~~~~
1 error generated.
Code:
[userx@FreeBSD64ssd test]$ sudo pkg info gcc9
gcc9-9.2.0
Name : gcc9
Version : 9.2.0
Installed on : Tue Sep 3 16:29:19 2019 CDT
Origin : lang/gcc9
Architecture : FreeBSD:12:amd64
Prefix : /usr/local
Categories : lang
Licenses : GPLv3, GPLv3RLE
Maintainer : gerald@FreeBSD.org
WWW : https://gcc.gnu.org
Comment : GNU Compiler Collection 9
Options :
BOOTSTRAP : on
GRAPHITE : off
MULTILIB : on
Shared Libs required:
libmpc.so.3
libgmp.so.10
libmpfr.so.6
Shared Libs provided:
libitm.so.1
libssp.so.0
libatomic.so.1
libcc1plugin.so.0
libcc1.so.0
libgcc_s.so.1
libquadmath.so.0
libcp1plugin.so.0
liblto_plugin.so.0
libstdc++.so.6
libgomp.so.1
libgfortran.so.5
Annotations :
FreeBSD_version: 1200086
cpe : cpe:2.3:a:gnu:gcc:9.2.0:::::freebsd12:x64
Flat size : 199MiB
Description :
GCC, the GNU Compiler Collection, supports a number of languages.
This port installs the C, C++, and Fortran front ends as gcc9, g++9,
and gfortran9, respectively.
WWW: https://gcc.gnu.org
Gerald Pfeifer <gerald@FreeBSD.org>
Code:
[userx@FreeBSD64ssd test]$ sudo pkg info gcc8
gcc8-8.3.0_2
Name : gcc8
Version : 8.3.0_2
Installed on : Sun Sep 1 17:02:20 2019 CDT
Origin : lang/gcc8
Architecture : FreeBSD:12:amd64
Prefix : /usr/local
Categories : lang
Licenses : GPLv3, GPLv3RLE
Maintainer : gerald@FreeBSD.org
WWW : https://gcc.gnu.org
Comment : GNU Compiler Collection 8
Options :
BOOTSTRAP : on
GRAPHITE : off
MULTILIB : on
Shared Libs required:
libmpc.so.3
libgmp.so.10
libmpfr.so.6
Shared Libs provided:
libitm.so.1
libssp.so.0
libatomic.so.1
libcc1plugin.so.0
libcc1.so.0
libgcc_s.so.1
libquadmath.so.0
libcp1plugin.so.0
liblto_plugin.so.0
libstdc++.so.6
libgomp.so.1
libgfortran.so.5
Annotations :
FreeBSD_version: 1200086
cpe : cpe:2.3:a:gnu:gcc:8.3.0:::::freebsd12:x64:2
repo_type : binary
repository : FreeBSD
Flat size : 188MiB
Description :
GCC, the GNU Compiler Collection, supports a number of languages.
This port installs the C, C++, and Fortran front ends as gcc8, g++8,
and gfortran8, respectively.
WWW: https://gcc.gnu.org
Gerald Pfeifer <gerald@FreeBSD.org>
whating to try and keep this uniformed, where it looks like gcc knows <filesystem> and c++ does not, yet neither work in the end.
what to do?