Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22233

Use compiled gcc to compile my code, but cannot found certain header files

$
0
0

I compiled gcc9 from source, and used default install prefix:

./configure --disable-mutilib
make -j16
make install

After that, I found the gcc version is updated:

which gcc
/usr/local/bin/gcc
gcc --version
gcc (GCC) 9.1.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

However, when I use it in my code:

#include <filesystem>
....

I compiled it with cmake as I used default system gcc:

mkdir -p build
cmake ..
make

I got the errors of:

/root/cpp/main_demo.cpp:17:22: fatal error: filesystem: No such file or directory compilation terminated. ...

I am sure the file filesystem exists in my install path, since I can find it with `find /usr/local -iname 'filesystem'.

What did I miss and how could I make it work?


Viewing all articles
Browse latest Browse all 22233

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>