This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS: Semantic error - Field 'xxxx' could not be resolved

Tool/software: Code Composer Studio

Running CCS 7.3 in Win 7 machine.

Trying to compile a project in which a struct has an element named pioStatus. This structure is declared in a file called "general_structures.h", which is included in the project's "main.h".

Compiler "insists" to give us a Semantic Error, saying that it could not resolve that field/element.

CTRL-Clicking the variable, and then the type definition clearly points to the header file which contains that structure, and the element is there.

Rebuilding, cleaning, index/rebuild, did not solve the problem.

Additional detail: There used to be an older "general_structures.h" file in which the pioStatus element did not exist. The older file is not in the context anymore, and the ctrl-clicking opens the correct new struct, but that might be somehow related to the problem.

Any suggestions? We're stuck on trying to compile the project...

Regards

Bruno

  • Bruno,

    My first suspicion would be exactly what you mentioned: an invalid path being passed to the compiler that still contains the previous version of the file. If your project contains both .h files, the GUI will try its best to search for the proper struct and eventually find it - something that will not happen during the command line.

    I strongly advise you to carefully look at the build output and try to spot in the "include" directories if there are more than one <general_structures.h> file in the listing of directories there. Or, I would do a "C/C++ Search" (hit Ctrl-H) and see if you can find multiple instances of the struct you mentioned.

    Hope this helps,

    Rafael

  • Hello Rafael,

    Thanks for the help.

    The CTRL-H is a powerful which I tend to forget. However, the search results were exactly just the ones expected.

    As for looking at the build output, I've copied the whole console into a text editor to better search for anything suspicious, but dit not find anything... :(

    Two additional bits of information after my original post:
    1) The compilation actually happens, the .out file is created. The "error" is not the traditional compiler error that we get when a structure element is missing, but rather a "less normal" Semantic Error which turns out NOT to prevent the build.
    2) SOME TIMES, when rebuilding the project, the 15 identical semantical errors show up on the console for a couple of seconds and then disappear!

    Hope that's of further help!

    Bruno
  • Bruno,

    1) Interesting. I missed the "Semantic Problem" description which indicates the problem is originated on the Code Analysis tool and not the toolchain. Since this issue seems to have started out of nowhere, several users report a similar scenario and possible alternatives to solve it.

    https://stackoverflow.com/questions/8148235/eclipse-cdt-shows-semantic-errors-but-compilation-is-ok 

    (in the screenshot above, you need to click on "Show advanced settings" in the bottom left corner)

    2) It is not uncommon for similar reports shown on the problems view to appear and vanish. During a project import or a build, the project manager scans files and may report a few things out of the ordinary while Eclipse is either refreshing or creating temporary files that will be responsible for linking the various resources of a project. The important part is that, at the end of the process, these "problems" are completely gone.

    Hope this helps,

    Rafael

  • Bom dia Rafael,

    Thanks for the guidance.

    First, I confirmed that the issue was indeed related to this Code Analysis: on those settings, I modified the "unable to resolve field" from ERROR into WARNING, and recompiled. Fine enough, the ERRORS no longer appeared, becoming WARNINGS instead.

    Looked at the StackOverflow linked you pointed me to. General comment there: as other CCS issues, "once something is messed up in metadata, it is indeed messed up!". Not even excluding the project and re-importing it did the trick. Hard solution was to create a new workspace, import the project, and the issue is solved.

    I could create a separate post, but it might just be a quick question: do you know an easy way to import the appearance color schemes from the previous workspace? I prefer the "dark" theme, but there are several highlights that needed to be adjusted, and figuring them out again ain't that productive...

    Thanks again for the help!

    Bruno
  • Olá Bruno,

    I suspect that what you are looking for is shown at the post below:
    e2e.ti.com/.../894369

    Please let me know if that is not what you are looking for, ok?

    Saudações,
    Rafael
  • Rafael,
    That was exactly that I was looking for!
    Obrigado.
    Bruno