0

I am trying to install a library from https://github.com/Koihik/LuaFormatter, and I got an error when I am using cmake .

-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- IPO / LTO enabled
-- Looking for C++ include filesystem
-- Looking for C++ include filesystem - not found
CMake Warning at CMakeLists.txt:30 (message):
  filesystem not found, use experimental/filesystem as fallback.  It's
  recommended to use a stable C++17 compliant compiler/libstdc++.

I am not a C++ developer and I am not sure what is the next step I need to take. I have checked this question, it seems like I need to have gcc 9 or 10, clang 9 or 10 and XCode LLVM 9.3 or later. I have installed all packages, but it is still not working. These are my version check:

❯ clang --version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Is gcc the problem here? It is Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1

❯ gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
❯ xcode-select --version
xcode-select version 2354.

Update

Following this answer, I have made an alias in .zshrc, but still I can't build correctly:

alias gcc='gcc-10'
alias cc='gcc-10'
alias g++='g++-10'
alias c++='c++-10'

Update 2

This is the error I am getting when I cmake .

#include <experimental/filesystem>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[1]: *** [CMakeFiles/cmTC_a8010.dir/fs.cpp.o] Error 1
make: *** [cmTC_a8010/fast] Error 2


CMake Error at CMakeLists.txt:61 (message):
  Your compiler does not fully support the C++17 standard and libraries
John Winston
  • 1,260
  • 15
  • 30

0 Answers0