Community
cancel
Showing results for 
Search instead for 
Did you mean: 
CBrou1
New Contributor I
1,411 Views

Eclipse IDE sees error that is not.

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...
7 Replies
Carlos_M_Intel
Employee
45 Views

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

CBrou1
New Contributor I
45 Views

Thanks for your response. Yes the code runs but the symbol "thread" remains flag non-resolved by the editor.

Carlos_M_Intel
Employee
45 Views

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

CBrou1
New Contributor I
45 Views

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.

CBrou1
New Contributor I
45 Views

I looked further into the issue and found a few interesting things and perhaps a way for you to reproduce the issue.

  1. The issue is not only pertaining to the library but occurs with other C+11 libs such as .
  2. If I create a new project and set the dialect the C+11 BEFORE I first compile. Everything is fine. Otherwise if I compile first and LATER change the dialect to C+11 then the code editor doesn't recognize the symbols from C+11 libraries (but the compiler and linker process the code without any issue). This is completely reproducible on two computers on which I installed the IDE..
  3. I compared the .cproject files of two versions of the same project with and without running the code before changing the dialect and I see no material difference.
  4. The main project I am working on "fixed itself" but I am able to remember what I was doing at the time.
Carlos_M_Intel
Employee
45 Views

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

Carlos_M_Intel
Employee
45 Views

Hi CABrouwers,

 

Do you have updates on this? Have you been able to avoid the error with thread?

 

Regards,

Charlie