Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile error #2

Open
huangnengCSU opened this issue Aug 26, 2021 · 3 comments
Open

compile error #2

huangnengCSU opened this issue Aug 26, 2021 · 3 comments
Assignees

Comments

@huangnengCSU
Copy link

Hi,
when I compile the code, it shows the error as follows:

huangneng@bio2:~/tools/CoLoRd-master$ make
g++ -Wall -O3 -std=c++17 -static -Wl,--whole-archive -lstdc++fs -lpthread -Wl,--no-whole-archive  -I src/colord/../common/libs/zlib -I src/colord/libs/kmc_api -I src/colord/libs/edlib -I src/colord/libs/CLI11 -c src/colord/utils.cpp -o src/colord/utils.o
src/colord/utils.cpp:28:10: fatal error: filesystem: No such file or directory
 #include <filesystem>
          ^~~~~~~~~~~~
compilation terminated.
Makefile:83: recipe for target 'src/colord/utils.o' failed
make: *** [src/colord/utils.o] Error 1

OS: Ubuntu 16.04
GCC: 7.5.0

best
Neng

@agudys agudys self-assigned this Aug 26, 2021
@agudys
Copy link
Member

agudys commented Aug 26, 2021

Hi,

It seems like GCC 7.5.0 doesn't have <filesystem> header. Could you please replace #include <filesystem> statement in src/colord/utils.cpp file with #include <experimental/filesystem> and recompile? In the future release we will add some automatic detection of GCC version.

Regards,
Adam

@huangnengCSU
Copy link
Author

To agudys,
Thanks for your response. I have modified the code according to your suggestion but there are still some error information.

huangneng@bio2:~/tools/CoLoRd-master$ make
g++ -Wall -O3 -std=c++17 -static -Wl,--whole-archive -lstdc++fs -lpthread -Wl,--no-whole-archive  -I src/colord/../common/libs/zlib -I src/colord/libs/kmc_api -I src/colord/libs/edlib -I src/colord/libs/CLI11 -c src/colord/utils.cpp -o src/colord/utils.o
src/colord/utils.cpp: In function ‘std::__cxx11::string create_tmp_dir(const string&)’:
src/colord/utils.cpp:310:20: error: ‘std::filesystem’ has not been declared
   auto path = std::filesystem::path(where) / name;
                    ^~~~~~~~~~
src/colord/utils.cpp:311:13: error: ‘std::filesystem’ has not been declared
   if (!std::filesystem::exists(path))
             ^~~~~~~~~~
src/colord/utils.cpp:314:9: error: ‘std::filesystem’ has not been declared
    std::filesystem::create_directory(path, ec);
         ^~~~~~~~~~
Makefile:83: recipe for target 'src/colord/utils.o' failed
make: *** [src/colord/utils.o] Error 1

Best
Neng

@agudys
Copy link
Member

agudys commented Aug 26, 2021

Well, it looks like suiting the code to GCC 7.5.0 may be not that easy. For now, I recommend installing GCC 8 at your system, as this is the version on which CoLoRd was tested. The following should work:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-8 g++-8
gcc-8 --version

Then, you can replace g++ with g++-8 in the makefile or change the default system compiler to GCC 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants