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.

Header files in CCS6

Hi

I've been using CCS 6 for about 6 weeks now but theres one aspect that troubles me... the ability to create a new header file and have it located in the folder containing all other header files. This folder is the one that is set as the search path folder for include files. I can click on project, then right click new->header file and the choices of destination are source,cmd,.launches,.debug etc absolutely no choice giving header or include file folder. I've ended off creating my new headers in the source folder then manually moving them into the include folder using explorer. Surely this isn't the method? I've searched online, offline in manuals etc and find nothing to state how to do this. Surely the purpose of having different file extensions is partly to group them under folders common to that extension hence having a folder specifically for .h files rather than .c files and maintain order. All I want to do is create file -> new header file and have it place this in the same folder as my current header files( imported as part of legacy project ).

I hope someone can answer my query, perhaps I'm being inept but I've tried various methods and all have failed to achieve their simple goal.

Best Regards

Martyn

  • Hello Martyn,

    I think for most large projects there is not just one folder for header files. My project probably has over 30 header file folders.

    I don't think there is a way to tell CCS to put all header files in one specific folder. However, you can right click on your header file folder (in the project explorer) and then select New->Header files and CCS will add the header file to that folder.

    Stephen
  • Hi Stephen

    Thanks for your reply. I agree there could be many folders for headers relating to different areas of a project. I perhaps didn't explain myself too well, I meant I'm happy to have several folders within the main folder titled "Includes". I'd like CCS to ask me which folder I'd like my new header to be placed in. On my CCS( v6 ) right clicking on a highlighted sub folder of "Includes" does not produce any menu or function at all. Nor so right clicking on "Includes". If I highlight a sub folder in the "Includes" folder I can use menu bar file-> new header file but it requests I supply a source folder from CCS's limited choices, it does not recognise a full file path if pasted into that field.

    Thanks for the possible solution, I'm using trackpad rather than mouse but all other functions in CCS seem to work with it so hopefully the right click is recognised. It may be that I have to create a new source folder for includes but a folder already exists with my other include files so that wouldn't be too sensible.

    Regards

    Martyn
  • On my CCS( v6 ) right clicking on a highlighted sub folder of "Includes" does not produce any menu or function at all. Nor so right clicking on "Includes". If I highlight a sub folder in the "Includes" folder I can use menu bar file-> new header file but it requests I supply a source folder from CCS's limited choices, it does not recognise a full file path if pasted into that field.


    I am a little confused. First you say "On my CCS( v6 ) right clicking on a highlighted sub folder of "Includes" does not produce any menu or function at all." Then you say "If I highlight a sub folder in the "Includes" folder I can use menu bar file-> new header file...". In the first sentence do you mean the"Includes" is a subfolder or do you mean sub folder in the "Includes" folder. If the former, I am not sure why there is not menu when you click on the "Includes" folder.

    Anyway, the information contained in the "source folder" text box will be the folder you right clicked on, so your header file will go into the folder you wanted it to go in.
  • Hi Stephen
    In the project explorer I have my Project folder within that structure CCS has Binaries, Includes, then Cmd,Debug and Source. The latter three are seen by code composer as genuine folders( within its view of the project structure - not a windows folder view ). The Includes, which when expanded shows include file paths, seems to be treat differently( it does not show a folder style icon but rather a set of files as in filing cabinet ). The paths shown within Includes expand to show all the separate header files each double clickable to edit. If I highlight on Includes or any of the paths displayed within it there is no right click menu or function. What I meant was I can click on the item to highlight it but must use the CCS File menu to get any functionality for header file creation. When going through the CCS main file menu to create a header file the Source Folder text box is not populated if the Includes folder or any of its sub-folders are highlighted. If you highlight the Source folder a full right click menu is present and this field is populated as you indicate. I think I must misunderstand the purpose of the "Includes" and its accessibility for adding new header files.
  • Ok, now I understand. "Includes" is not actually a folder. Its only purpose is to show you all of your include paths.
  • Thats good its clarified what I was thinking. It means I either have to have header files mixed with source files all under the source folder or do as I do and manually move them into the header files ( Include ) folder within the project folder on hard disk. I'm sure there must be an automatic way to do this but all searching so far hasn't found anything. I think its time to retire as my thinking is "Includes" should have the same attributes as the Source folder, hence the same menu capability and file creation ability.
    You mention above Stephen how Includes is simply meant to show all your include paths but all files are still click editable from it so it does have folder properties to some extent but not at the top level as per Source.
  • I am using CCSv6.01.0040 and with the exception of  standard library include files, I am not able to access or see any of the header files within "Includes".  However, I am able to access and see the standard library include files (stdio.h and etc.).

    You don't need to mix the header files with the source files.  Please see example project I made up below.  I added the include files by right clicking on the specific folders I wanted the include files to be in and selected New->Header Files.   "Includes" will show all the include paths as specified in the Include Options located in the project properties.  I also included the the Example Project's Includes options below.

  • Thanks Stephen( I used this name, hopefully correctly, from your first mail reply but notice you have Steven on your user id ), I've just added folders in the project and in effect created my own structure similar to your own. That works as I knew to set up the include path so as to see the include files in the CCS "Includes" display and allow files to be read in at compilation. My own project is a legacy CCS 3.3 import from another company and CCS created a folder Source, my failing was in thinking that CCS would understand that the extension .h should be saved into an include file folder that the user could browse for. In my case that being the folder where the main 28335 headers are kept( for now anyway that will change ). I think thats sorted, basically CCS needs to have folders created and it doesn't mind what file you create in them, you could mix all extension types. CCS doesn't look to putting .h files in folders having "Include" file oriented attributes, they're all just simple folders and setting the include paths allows all headers to be viewed via the shortcut "Include" tab in the display( as well as providing the search path for compile ). This "Include" tab can't be set as a folder as beneath it are directories that can bear no relation to each other in terms of a common root directory. Its purely representational and a shortcut access to all header files in the project. Thanks for that.
  • Yes I think thats sorted. I was perhaps thinking CCS was more controlling/high level than it actually is.... now to attempt to sort out why a colleagues code refuses to run in flash when XDS100 not connected. Now that shall be fun :-).
  • Hello Martyn,

    Please mark the appropriate post or posts above as answered.

    Thanks,
    Stephen