do you work in within iotdk Eclipse IDE?
Are you sure it's a compile error?
Background: although you can set c++11 within the Kepler Eclipse there are issues with resolving c++11 symbols - I haven't tried with std::mutex but with std::string which also came with c++11.
In the latter case Eclipse would tell me "can not be resolved" but would still compile fine.
Afaik it's a known issue with "Kepler" version of Eclipse that the resolve doesn't quite work for c++11.
I've gotten std::string to work no problem and right away. The weird thing is when I look at the header for mutex and place invalid symbols to compile I get errors above the ###_base classes but when I place an invalid symbol above class mutex I don't get an error. So I'm not sure why all of a sudden there I don't get an error, it's like the compiler is just stopping there.
Were you able to solve this error when compiling? Let us know if you still need help.
No, I was never able to get this to compile. From what I've read around the forums, this just might not be supported in the compiler. Even if I just create a basic app for Edison it still won't compile and I get those errors.
do you see the same behaviour in the new release?
No I did not. I'll have to download that version and give it a try.
No still get the error 'Type 'std::mutex' could not be resolved'
1 of 1 people found this helpful
Please follow the following instructions.
I was able to build and run the mutex example available here: http://en.cppreference.com/w/cpp/thread/mutex
Tested on Windows 7, with an Edison and Eclipse IoT Dev kit v1.0.
Go to Project Properties->C/C++ Build->Settings->Tool Settings->GCC C++ Compiler->Miscellaneous->Other Flags.
Put "-std=c++11" at the end.
Go to Project Properties->C/C++ General-> Preprocessor Include Paths, Macros etc. ->Providers
In “CDT CROSS GCC Built-in Compiler settings”, put "-std=c++11" at the end.
Rebuild the index with Project -> C/C++ Index -> Rebuild
Please let us know if you still get error messages!
Ok, I still had some issues trying to compile the code. It looks like its more of a symantic error. I tried creating a brand new project and now I get off the wall errors. I did posted them here: https://communities.intel.com/message/285248#285248
Not sure why the new version of the iotdk-ide-win doesn't like me
I got the same error. It's more of a semantic error right now. I set the standard defines as c++11 and I also tried c++0x and both didn't work. I've posted my project, maybe I'm missing something.
I take a look at your project and your compilation’s issues and it seems that your project’s settings are not set correctly.
The easiest way to resolve this will be :
- Create a new IoT C/C++project
- Copy/paste the content of your files inside the project
- Set C++11
- And enjoy!
Ok, I did exactly what you said for me to do. I created a new IOT C++ project, copied the main.cpp code into the new file and set it to C++11 for the dialect. I still get the same error.
So if my project settings are still not set correctly then there is something wrong with the Edison eclipse install.
My error is:
Type 'std::mutex' could not be resolved test.cpp /test/src line 40 Semantic Error