Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 310 Vote(s) - 3.6 Average
  • 1
  • 2
  • 3
  • 4
  • 5
eclipse C project shows errors (Symbol could not be resolved) but it compiles

#1
I have got access to a C project at work that I have to implement some stuff in. I was able to load it into eclipse and can `Project -> Build All` it. Compilation shows no errors or warnings. But in eclipse, there are a lot of errors shown. One example:

----------
There is an enum

typedef enum MeasurementType {
PN, BB, AM, RES
} MEAS_TYPE;
MEAS_TYPE type;

in one of the files. It is used somewhere else and produces an error like this:
![enter image description here][1]

It is most interesting, that only `AM` seems to be a problem, not `PN` or `BB`.

----------

I haven't found a satisfying solution to this. I already tried to include all possible directories I could think of in `Project Properties -> C/C++ General -> Paths and Symbols` (like [this post][2] suggests), but that didn't help.

The project itself is compiled with Makefiles (which is why I need `Project -> Build All`). Can it be that eclipse does not interpret those Makefiles correctly or something? I am a bit lost after messing around with that stuff for a few hours and not getting a single step forward.

EDIT: Here are some screenshots for my build-relevant project properties (at least I believe they are relevent :D). Tell me if you need more information.

![enter image description here][3] ![enter image description here][4]


[1]:

[2]:

[To see links please register here]

[3]:

[4]:
Reply

#2
It looks as if Eclipse (not gcc) is setup to parse the wrong or some additonally, propably outdated (include) source files.
Reply

#3
Since I got a suggestion from moooeeeep, I will post the solution here. I am still accepting alk's answer, because he was the one that showed me towards the right direction.

**My solution:**

If I click on `AM` in eclipse (the one that is underlined with red) and press `F3` to go to the declaration, it actually asked me to which declaration I want to go. It listed the (correct) enum constant as well as some variable from somewhere else. Therefore the problem was that multiple declarations of `AM` were present in different code locations.

I fixed this problem by just **renaming** the `enum` constant to something else (`AN` in my case). There is no variable with the same name in the code and therefore eclipse was able to refactor it correctly.
Reply

#4
There is a bug report added in Eclipse CDT Bugzilla with regard to this problem:

[To see links please register here]

Reply

#5
This is quite an old question, but I hope this short answer can be useful to someone.

I was having similar errors with enums in the IDE but not when compiling, which seemed to indicate a bug in Eclipse's Codan. After upgrading to the new version of Eclipse (Neon 4.6) released in June, the errors have disappeared. Just try updating Eclipse!
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through