Reputation: 3927
Use eclipse-cdt (latest version ) on Ubuntu. I create new project with one line code - mutex declarative.
compilation passed (compile with eclipse), but eclipse mark the mutex in red and complain on - 'mutex type could not be resolved'
i add ' -std=c++0x -pthread' to the g++ and refresh eclipse indexer, but didnt help.
Any advice?
#include <mutex>
using namespace std;
static mutex m;
int main(int argc, char *argv[]) {
}
Upvotes: 2
Views: 8067
Reputation: 401
-D__cplusplus=201103L helped me. Using Eclipse Luna. GXX_EXPERIMENTAL_CXX0X didn't help
Upvotes: 1
Reputation: 3927
C/C++ General -> Paths and Symbols -> Symbols -> GNU C++. Click "Add..." and paste __GXX_EXPERIMENTAL_CXX0X__
(ensure to append and prepend two underscores) into "Name" and leave "Value" blank.
This solve it.
Upvotes: 4