I am working with Eclipse and using the library.
The code compiles and runs perfectly .. .but the editor flags symbols from the library as unresolved .. even though the tool chain is fine with them !.
How can I fix that ?
- - - - - - - - - - - - -
Eclipse Version: Luna SR2 (4.4.2) Build id: M20150204-1700
Edison image version: 159.devkit
I have set the project properties :
C/C++ Buid/Settings/Tool Settings/Cross GCC Compiler/Dialect/Language Standard -> ISO C11 (-std = C11)
C/C++ Buid/Settings/Tool Settings/Cross G++ Compiler/Dialect/Language Standard to -> ISO C11 (-std = C11)
in my test code, the symbol thread is marked as "Type 'thread' could not be resolved".
# include "mraa.hpp"
# include
# include
using namespace std;
void hello(){
for (;;) {
cerr << </span>"Hello!" << </span>endl;
sleep(1);
}
}
void goodbye(){
cerr << </span>"Goodbye!" << </span>endl;
}
int main() {
thread athread (hello);
for (;;) {
goodbye();
sleep(1);
<p style="margin-bot...Link Copied
Hi CABrouwers,
With Eclipse Version: Luna SR2 (4.4.2) (Help > About Eclipse Platform) and the Edison image version: 159.devkit (configure_edison --version)
I was able to run your code without problems by doing the following.
By doing right click on the project > Properties > C/C++ Build > Settings > Cross G++ Linker > Miscellaneous and add -std=c++11 -lpthread on Linker flags. After this, click on Apply and OK
Let me know if this works.
Regards,
Charlie
Thanks for your response. Yes the code runs but the symbol "thread" remains flag non-resolved by the editor.
Hi CABrouwers,
Which Eclipse IDE are you using? And which image version do you have on your board?
Are you using Eclipse Luna SR2 (4.4.2) and image 159.devkit?
Try with right click to the project > Properties > C/C++ Build > Settings > Cross G++ Compiler > Dialect > Language Standard : ISO C+ ++11 (-std=c++0x)
And check the Providers by right clicking to the project > Properties > C/C++ General > Preprocessor Include Paths, Macros etc. > Providers.
Regards,
Charlie
Charles,
Thanks for your response.
I tried/checked all you indicated .. .the problem remains. The code is produced and runs but the editor flags an error that is not.
I am working with a fresh IDE download :
Version: Luna SR2 (4.4.2)
Build id: M20150204-1700
and runing 159.devkit on the Edison.
I looked further into the issue and found a few interesting things and perhaps a way for you to reproduce the issue.
Hi CABrouwers,
After doing the changes in the settings of the project, try by selecting the Project Tab that is next to the Run Tab on the IDE and then click on Build Project, this should take the new changes in the project.
Regards,
Charlie
Hi CABrouwers,
Do you have updates on this? Have you been able to avoid the error with thread?
Regards,
Charlie
For more complete information about compiler optimizations, see our Optimization Notice.