-
-
Notifications
You must be signed in to change notification settings - Fork 264
adding "--gcc-toolchain" in running command option #457
Description
This is just a usage hint for example in "https://github.com/andreasfertig/cppinsights#usage".
In case user build its own GCC compiler, i.e. gcc-11.2.0, and NOT installed in default system path, then after building clang it cannot find correct libstdc++ path. This is because clang is purely depended on GCC builtin stl. The example is using "-isystem/usr/include" which is assuming user has installed GCC in default path. So, to solve this issue user can use "--gcc-toolchain=/path/GCC-1x.x.x/installed/path".
issue description:
- ubuntu18.04
- customize building GCC-11.2.0 and installed in customized path
- building clang-13/14 and install to default system path
- running following command will generate error
./cppinsights.exe Insights.cpp -- -std=c++20
In file included from /home/nick/Downloads/cppinsights/Insights.cpp:24:
In file included from /home/nick/Downloads/cppinsights/CodeGenerator.h:20:
/home/nick/Downloads/cppinsights/InsightsUtility.h:24:32: error: no member named 'same_as' in namespace 'std'
concept same_as_any_of = (std::same_as || ...);
~~~~~^
/home/nick/Downloads/cppinsights/InsightsUtility.h:24:40: error: 'T' does not refer to a value
concept same_as_any_of = (std::same_as || ...);
^
...
solution:
./cppinsights.exe Insights.cpp -- --gcc-toolchain=${GCC_11_2_0_INSTALL_PATH} -std=c++20
Here "${GCC_11_2_0_INSTALL_PATH}" is where your customize-built GCC installed "root" path. Detail as clang help here.