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: C2000 *.lib and *.obj

Tool/software: Code Composer Studio

Hi,

Customer is using C2000 (F2803x, F2823x and others) for their projects.

They have some questions when creating *.lib and *.obj:

1) Can *.c and *.h be included in the *.lib or *.obj?

2) When creating *.lib and *.obj, can "#include xx.h" be used in *.c? If yes, is there any risk?

Thanks a lot.

Br, Jordan

  • Hello,

    Jordan Zhou said:
    1) Can *.c and *.h be included in the *.lib or *.obj?

    An object file is outputted by the assembler and the result of compilation of a source file (*.c, *.s, etc). It is code and symbols for the file. A library is a collection of object files.

    This graphic explains it well:

    http://software-dl.ti.com/ccs/esd/documents/users_guide/sdto_ccs_build-handbook.html#main-build

    Jordan Zhou said:
    2) When creating *.lib and *.obj, can "#include xx.h" be used in *.c? If yes, is there any risk?

    Yes. This is very common. Many *.c files often include other header files and then when the *.c file is compiled, an object file is generated.

    Hope this helps

    ki