I'm having a strange error (Semantic Error) in Eclipse Oxygen C++ with MINGW
compiler.
when I try to use an unique_ptr
, eclipse issues an error:
Method 'method_name()' could not be resolved --> Semantic Error.
Example proposal:
#include <iostream>
#include <memory>
#include <string>
using namespace std;
struct Demo {
Demo(): a(1) {}
void doSomething() {cout << a << endl}
int a;
};
int main() {
unique_ptr<Demo> demo = make_unique<Demo>();
demo->doSomething(); //
return 0;
}
Some fail images:
It compiles and work, but the problem never dissappear, any idea to fix it? Is not a problem due to c++14 and make_unique, beacause using a raw pointer it works as well and the problem also persists.
int main() {
unique_ptr<Demo> demo (new Demo);
demo->doSomething(); //
return 0;
}
Thanks in advance.