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.

CCSv5.1: Project header file problems

In my projects (for F28335) that I imported from CCSv3.3 pjt files I have the following problems with project header files:

  • The header files are not shown in Project Explorer. I can open the header files by CTRL+Left Mouse Button when I point the mouse pointer to an #include directive in one of the C files.
  • If I try to modify a header file that is write protected I am not asked by CCS whether it should be made writable. I can't change the file until I made it writable (with Windows Explorer, e.g.). If I try to modify a write protected C file CCS asks.
  • If I change a header file after having built the project and ask CCS to build the project again it doesn't recompile the C files that include that header file.

Unfortunately, I'm unable to reproduce the behavior with one of the example projects provided by TI.

AFAICT, the dependency files look OK. I.e., foo.pp contains a line

foo.obj: bar.h

when foo.c includes bar.h (in foo.pp all filenames are prepended by an absolute path, of course).

Where should I look for the reason for the problems described above?

Regards, Johannes

  • Hello Johannes,

    Regarding the header files, just a few more questions?

    -Is the path to it part of the compiler build options (--include_path=<path>)?

    -where are the header files in relation to the project folder?

    Thanks

    ki

  • Hello Ki,

    Ki-Soo Lee said:
    -Is the path to it part of the compiler build options (--include_path=<path>)?

    No, it isn't.

    Ki-Soo Lee said:
    -where are the header files in relation to the project folder?

    The project source files are distributed over several directories. Most of the header files are in the directories of their respective C files:

    dir1/foo.c dir1/foo.h dir1/bar.c dir1/bar.h

    dir2/foobar.c dir2/foobar.h

    if foobar.c requires the inclusion of foo.h it is included via

    #include "../dir1/foo.h"

    If I add the project root directory to the compiler options include path, the whole directory tree (including the header files) appears in Project Explorer under "Includes".

    I want to avoid adding all directories that contain header files to the include path.

    Regards, Johannes


  • Hello Johannes,

    I believe I see all three issues you reported. I just want to confirm one thing.

    I assume that you are dealing with linked source files with the source and header files outside the project directory. Hence your header files are not appearing in the project view since it is only showing any files in the project folder + all linked source files  + any include directories specified in the include search paths of the build options.

    I can reproduce the second and third issue. I will send this for further investigation but I just want to confirm the the one assumption I have.

    Thanks

    ki

  • Hello Ki,

    Ki-Soo Lee said:
    I assume that you are dealing with linked source files with the source and header files outside the project directory.

    Yes, the project directory only contains .ccsproject, .cproject, .project, directory .settings,  and a directory hierarchy that resembles the source file hierarchy with .opt, .pp, .mk files. No C, nor H nor ASM files are contained in the CCSv5.1 project directory.

    Regards, Johannes

  • The fact that changes in header files are not "detected" when building is very annoying! Any news on this?

  • Not sure if I'm breaking the rules by necroposting and/or bumping, but I really would like some input on this.

    Thanks
    Daniel

  • I have also met this issue. It seems the reason is path comparison in GNU make utility. gmake considers the following two paths different:

    1) <...>/Beans/Release/obj/main.obj

    2) <...>/Beans/beans/../Release/obj/main.obj

    The problem is that makefile rule for the output executable is written in style 1, while the file <...>/Beans/beans/Release/main.pp uses style 2 describing main.obj header dependencies. Once I manually fixed main.pp to first style, everything is ok, build starts upon change of version.h. However, main.pp is re-created during build and problem returns.

    I think this wouldn't happen if the project was created in the SRC_ROOT, i.e. SRC_ROOT == PROJECT_LOC.

    I found the following treatment for this problem.

    See the attached picture.

     

    You can also fix this in manual mode if you change object directory to be absolute path, not relative to SRC_ROOT or PROJECT_LOC.