This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

using shortcuts to name header files

I tried to use a shortcut(alias) to point to a C header file but uVision2 couldn't resolve the shortcut when opening the project. So I have a shortcut with the name header.h that can point to header1.h, header2.h, and so on, but Uv2 can't figure out where header.h is pointing. Is there a solution to this beyond the obvious of multiple #includes, etc.?

Parents
  • "So I have a shortcut with the name header.h that can point to header1.h, header2.h"

    Sounds like a maintenance nightmare!
    What happens if you point the shortcut at the wrong header?

    It's generally far better to keep this stuff within the project, where it's all controlled by the tools.

    Look at uVision's facilities for different project Targets.
    Use a #defined symbol, or a symbol defined by the project, to select the appropriate headers using #if, etc...

    If uVision's facilities are too simplistic for you (which is quite possilbe) look a some version of make, or build you own batch files...

Reply
  • "So I have a shortcut with the name header.h that can point to header1.h, header2.h"

    Sounds like a maintenance nightmare!
    What happens if you point the shortcut at the wrong header?

    It's generally far better to keep this stuff within the project, where it's all controlled by the tools.

    Look at uVision's facilities for different project Targets.
    Use a #defined symbol, or a symbol defined by the project, to select the appropriate headers using #if, etc...

    If uVision's facilities are too simplistic for you (which is quite possilbe) look a some version of make, or build you own batch files...

Children
  • "Use a #defined symbol, or a symbol defined by the project, to select the appropriate headers using #if, etc..."

    And taking that one small bit further, if using #if's in each source file to select the appropriate header files is undesireable, don't forget that the #include itself can specify preprocessing tokens, thus allowing all the #if'ing to be localized.