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

How to get rid of Eclipse indexer "Type std::... could not be resolved" errors in imported make project

$
0
0

Steps to reproduce.

  1. Use Linux system where g++ defaults to standard older than c++17, but supports c++17 if given -std option
  2. Create trivial C++ project outside of Eclipse with main.cpp:
#include <filesystem>int main(){    std::filesystem::path p;    return 0;}
  1. And Makefile:
all: a.outa.out: main.cpp    g++ --std=c++17 -lstdc++fs main.cpp
  1. 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.


Viewing all articles
Browse latest Browse all 22042

Trending Articles



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