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: CCS 7.4: globally predefined symbols not present for all source files

Tool/software: Code Composer Studio

I have a project (for C2000) with several C and H files. Today I added a new global predefined symbol: In project explorer right click on project->Show build settings->Build->C2000 Compiler->Predefined Symbols I added TEST_SYMBOL.

Then I recompiled the whole project and was surprised that only 54 out of 95 files were compiled with "--define=TEST_SYMBOL".

Moreover, when I opened one of the files that were compiled without "--define=TEST_SYMBOL" and put some of the code inside

#ifdef TEST_SYMBOL

#endif

the code between #ifdef and #endif was not grayed out, i.e. the IDE was seeing things different than the compiler/preprocessor. This is really annoying.

According to which rules are globally predefined symbols propagated to project members?

What do I have to do to #define a symbol that is to be seen by the preprocessor in every file when compiling the project?

Regards, Johannes

  • Johannes,

    If the predefined symbol was added at the project level I would expect it to propagate to all source files in the project unless it is explicitly removed from specific source files using File Specific options. 

    Are you able to share the project that demonstrates this issue? That will help us reproduce the behavior and try to understand the reason for it. If you do not wish to share the project here you can send it to me via private conversation.

  • The user shared the project in private.

    In summary, the project was set up in a way that a specific folder (and all source files inside it) had file specific options for the --define option. Since the option was identified as "file-specific", modifying it at the project level did not have an effect on the files within this folder because the project system believed that it should not be updated.

    To allow the project level options level to propagate down to all files, you could either set all project level options first prior to adjusting that same option at a file/folder specific level. Or manually add the new options to the files/folder that are set for "file-specific" options in addition to adding them at the project level.