1

I'm having an issue with Eclipse Oxygen where Eclipse cannot find anything in the standard lib:

This is a snippet of code that I have:

#include <iostream>
#include <asio.hpp>
#include <memory>

....

typedef asio::io_service service;
typedef std::shared_ptr<service> servicePtr;

The shared_ptr is highlighted with an error saying "Symbol 'shared_ptr' could not be resolved". I receive this error on any object that uses the std:: namespace.

For instance if I have

#include <atomic>
....
std::atomic<bool> myBool;

Same error as before but Eclipse cannot find Symbol atomic

However the includes do not have any such error saying the header could not be found.

This started happening when I needed to use C++11 using g++ from another directory (/opt/dev/usr/bin/g++) who's --version is g++ (GCC) 5.3.1 20160406

I set that path as the command as my GCC C++ compiler in my Project->Properties->C/C++ Build->Settings->Tool Settings.

I also added the /opt/dev/usr/include directory to my Library paths and exported it.

There is also my /usr/include /usr/local/include in the includes which I think may be messing the indexer up but I don't know how to tell Eclipse to ignore those paths.

I'm unsure what I need to do to allow Eclipse to recognize any of the standard libraries again...

scholarhedge
  • 93
  • 1
  • 5
  • Did you set the language standard? See Project->Properties->C/C++ General->Preprocessor Include Paths, Macros etc., Providers tab, CDT GCC Built-in Compiler Settings entry, look at the "Command to get compiler specs" entry box. You may need "-std=c++11" in the command line there. – Fred Larson Dec 11 '17 at 21:52
  • See also this question: https://stackoverflow.com/q/39134872/10077. It's for Neon, but the answer should be the same. – Fred Larson Dec 11 '17 at 21:58

0 Answers0