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: CCS7 automatically links all .obj & .o files, even if it did not create them

Tool/software: Code Composer Studio

Hi folks,

I have a small issue with CCS7 (was also present in CCS6): it links all *.obj and *.o files in the build directory that it can find, even those that it didn't create. The annoying downside of this is, that if a .o or .obj file was created by some other tool, CCS will produce very strange and numerous errors.

Could this be changed? I don't think this is intended behavior, since it can cause the unwanted inclusion of symbols & data in a build when a stray .o file is left in the source directory from a previous build.

Cheers,

Dan

  • Dan Cermak said:
    I don't think this is intended behavior,

    Dan,

    Actually this is in fact the intended behavior. All files in the project directory are considered part of the build: if they are source files they will be passed to the compiler, if they are object files they will be passed to the linker.

    There are a couple of ways you can work around this: 
    1) you can explicitly exclude the object files that you don't want to be included in the link
    2) you can add additional clean commands to delete specific/all object files so they get run during "clean project". Please see this wiki section for an example. 

    Hope this helps.

  • Well, that's an odd choice for a default. I guess there isn't a way how to turn this behavior of? If I understand CCS correctly, it uses make under the hood to build projects, so the object files have to be explicitly specified for the linker. Is this scripted in an easy to modify way, or would one have to modify the eclipse sources?

    Anyway, I know how to fix it. Before I open CCS I run a scons -c in my build directory which generally works, unless I have renamed a file and not deleted any left behind object files (scons won't care about those and thus also not clean them).

  • Dan Cermak said:
    If I understand CCS correctly, it uses make under the hood to build projects, so the object files have to be explicitly specified for the linker. Is this scripted in an easy to modify way, or would one have to modify the eclipse sources?

    If using a custom makefile, yes it can be customized as desired, but if using the managed build system (ie. letting CCS generate the makefile automatically), then I don't believe there is an easy way to modify this behavior.