Steps to reproduce.
- Use Linux system where g++ defaults to standard older than c++17, but supports c++17 if given -std option
- Create trivial C++ project outside of Eclipse with main.cpp:
#include <filesystem>int main(){ std::filesystem::path p; return 0;}
- And Makefile:
all: a.outa.out: main.cpp g++ --std=c++17 -lstdc++fs main.cpp
- Use Eclipse
File->Import->C/C++->Existing Code as Makefile Project
to create project over directory with those 2 files
Project builds properly, but indexer finds unresolved inclusion filesystem
and type std::filesystem::path
. In more complicated real world case there were no unresolved inclusions, but a lot of unresolved types were present.
Google finds lots of suggestions to set -std=c++17
in Properties->C/C++ Build->Settings->Tool Settings->GCC C++ Compiler->Miscellaneous->Other Flags
but for imported makefile projects Tool Settings
are disabled (my Eclipse version was 4.14, but I guess that this is the case for other versions too), sot this is not a way to go.