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.

RE: CCS 5: set PATH variable, include search paths for all projects of an ISA, rather than a particular project

Hello Lisa, I tried to simplify my include path using a variable as you suggest, but I can't make it work.

My header file is at /home/errol/Dropbox/lib/include/timer.h

If I reference it as #include "/home/errol/Dropbox/lib/include/timer.h", CCS5.2 can resolve it.

If I set a variable and use a relative reference, CCS5.2 can't find it.

The variable I used is COMMON_SRC, set from Window->Preferences->General->Workspace->Linked Resources with the value /home/errol/Dropbox/lib

(COMMON_SRC then appeared at Project  > Properties > Resource > Linked Resources > Path Variables)

then from Project  > Properties > CCS Build > MSP430 Compiler > Include Options I added "${COMMON_SRC}/include" to the #include search path

In main.c I included timer.h as #include <timer.h> and a question mark popped up with the message Unresolved inclusion: <timer.h>

If I compile it, two warnings result ! Build variable 'COMMON_SRC' cannot be resolved and ! Invalid project path: Include path not found (/include)

Where have I gone wrong?

  • HI Errol,

    what OS are you using?  Would you be able to send a screenshot?  Are you using LInux? 

    Best Regards,

    Lisa

  • Errol Kowald said:

    The variable I used is COMMON_SRC, set from Window->Preferences->General->Workspace->Linked Resources with the value /home/errol/Dropbox/lib

    (COMMON_SRC then appeared at Project  > Properties > Resource > Linked Resources > Path Variables)

    then from Project  > Properties > CCS Build > MSP430 Compiler > Include Options I added "${COMMON_SRC}/include" to the #include search path

    To use variables with compiler options, such as #include search path, they need to defined under "Build Variables" rather than under "Linked Resources".

    Errol Kowald said:

    If I compile it, two warnings result ! Build variable 'COMMON_SRC' cannot be resolved and ! Invalid project path: Include path not found (/include)

    This message indicates that COMMON_SRC has not been set as a "build variable".

    You can set it either at the workspace level or project level. To set at workspace level, go to Window->Preferences->C/C++->Build->Build Variables. Add your COMMON_SRC there and then you should be able to use it in your include options.

    To set it at the project level, go to Project Properties-> C/C++ Build->Build Variables, and add it there.

    More info here: http://processors.wiki.ti.com/index.php/Portable_Projects#Specifying_compiler.2Flinker_options_2

  • Sorry for the tardy reply (I've been crook), but thanks for that. Problem solved.

  • Hi Errol,

    ok, glad to hear things are resolved.  All the best with development.

    Best Regards,

    Lisa