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.

How to use a relative path in a linker command file (CCS4)

I want to use a relative path in a command file for the DSP2803x, but I cannot arrange it:

not by using "..\filename.obj", "../filename.obj",

nor by using  "${PROJECT_ROOT}/filename"

nor by any combination of them.

The line in the command file looks like:

.csconf:       load = VAR_INFO, PAGE = 2, TYPE = COPY { "filename.obj" (.econst) }

Error message: cannot find file "filename.obj"

 

An absolute path works fine, but is not an option.

  • Relative paths are supported. Try making that path relative from the configuration folder. So if the object file is in the project root folder, you need to do something like:

    Markus Grossniklaus said:
    .csconf:       load = VAR_INFO, PAGE = 2, TYPE = COPY { "../filename.obj" (.econst) }

    Thanks

    ki

  • Hi ki

    May be I did not point it out clearly enough:

    - the following principle DOES NOT WORK:           .csconf:       load = VAR_INFO, PAGE = 2, TYPE = COPY { "..\filename.obj" (.econst) }

    - the following principle DOES NOT WORK:            csconf:       load = VAR_INFO, PAGE = 2, TYPE = COPY {"../filename.obj" (.econst) }

    - the following principle DOES NOT WORK:            csconf:       load = VAR_INFO, PAGE = 2, TYPE = COPY {"${PROJECT_ROOT}/filename.obj" (.econst) }

    -  any combination of the above shown principles DOES NOT WORK

    Error message: cannot find file "filename.obj"


    What could be the problem?

    Thanks

    Markus

  • Markus,

    Where is filename.obj located relative to the CCS project folder? Is the corresponding source file filename.c added to the project or is this a separate object file being added to the link? If the source file is added to the project, just specifying the file name (without any path information) in the linker command file should be sufficient. Otherwise specifying the path relative to the configuration folder as pointed out by Ki should work.

    If you could provide more details about the location of this file and how it is generated, it might help figure out why you are getting the error.

  • Where is filename.obj located relative to the CCS project folder?

    >> It is located in c:\work\Product\Tools\CCS4\Obj\

    >> that means: right at the side of the project folder:c:\work\Product\Tools\CCS4\<projectFolder>

    Is the corresponding source file filename.c added to the project or is this a separate object file being added to the link?

    >> the source file symbols.c is linked, not added, because it resides in a directory used for multiple projects

    If the source file is added to the project, just specifying the file name (without any path information) in the linker command file should be sufficient. Otherwise specifying the path relative to the configuration folder as pointed out by Ki should work.

    >> when I try with:

       .csconf:       load = VAR_INFO, PAGE = 2, TYPE = COPY {  "../../Obj/symbols.obj" (.econst)  }

    >> IT WORKS!!

     

    >> when I try with:

       .csconf:       load = VAR_INFO, PAGE = 2, TYPE = COPY {  "..\..\Obj\symbols.obj" (.econst)  }

    >> IT WORKS TOO!!

     

    Thank You Arti!

    You made me do once again, what I did before in many different variants and I had never seen it working: errare humanum est!

     

  • Hi Ki,

        I agree that for obj files, relative paths are supported.

    But, is it possible to specify these object file paths as file specific, or project specific options, and make cmd file free from path specifications.