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.

Grouping include files in C/C++ projects view & elminating clutter

Q1: In Codewrite,  header files and C source files and other file types are grouped in the project view pane, regardless of where those files are located, which is a handy way of organizing things in the project view pane.

I want to do the same thing with CCS 4.2.4.  I found an option under the "Window->preferences" menu item, in the C/C++ ->Appearance field, which is a check box labeled "Group the includes in the C/C++ projects view".  Seems like just what I am looking for, but when I check it, hit apply and close out the menu, it does not change the appearance in the C/C++ projects view.  I still see a list of first .h files, and then .c files.

 

Q2: CCS automatically brings any file underneath the Project Root into the  project, which creates addtional clutter in the C/C++ projects view pain,  for example when my editor creates a backup copy of a file a source file.  I see all these *.bak files listed.  How do I exclude certain file types from being displayed in the project view pane.

thanks,

-S

  • Shawn,

    You can organize files in folders in a couple of different ways.  I am running CCSv5.1.1.

    Right click on your project and select to create a new folder.  By default this will create a physical folder in your project directory.  You can then move files into this folder.  However if you don't want to change your file structure then click on the advance button and then select to create a virtual folder.

    The trick with virtual folders is that all the files in it have to be what are called linked files.  I.e. they are located somewhere else.  Select the folder, in v5 you would then go to the project menu and select "Add Files" and it would help you link files to this folder.  In v4 you would need to select the "Link Files" menu item.

    As far as filtering files you can do that as well.  Click on the little down arrow in the top right hand corner of the Project Explorer (v5) / C/C++ Projects View (v4).  Select customize view (v5) or Filters (v4).  You can then select filters to apply.

    Regards,

    John

  • Thanks for the info.  Is this a feature only available in CCS v5?   I am running v4.2.5 and my dialog box looks like:

    ( ?? Can't get the cut-n-paste of my screen capture from word to show up... (How are you inserting the screen captures into the post?) I see instructions for inserting image files, but that would be kinda combersome to paste my screen capture into word and save as a tiff or something.)

    Well if you could see the picture, the only option listed is [ ] link to folder in the file system.

    in v4, I tried to link to the same folder where my files are located, but it won't let me, mainly because the files that I want sorted are already part of my project (i.e. they are in a subdirectoy under the project root)

    I'm not sure I understand how the method would work in v5 either, since all files within a virtual folder have to be linked files, and I will be trying to link to files already under my project root.   Any other suggestions I could try?  (Also, let me know the trick to easily capture screen shots and put them into posts)

    thanks,

    -S

     

  • For screen shots you can just to alt-printscreen and then paste into paint to save as a .png or .jpg.  Then you can add to a post using the insert image button.

    The Eclipse IDE in CCSv5.1 is a lot newer than CCSv4.2.5.  Basically 5 years of changes.  I pulled up a 4.2.4 install and it doesn't have the virtual folder option so this appears to be new in CCSv5.  It is really meant to be used when all your source files are located outside your project structure and then you create the virtual folders and link the files into them.

    In your case as you have everything in your project folder the best option would be to create real folders within the project structure and move the files into them to organization them.  You can do this with in the C/C++ projects view by first right clicking and creating a new folder and then you can drag the files into the folders.   

    John

  • John,

    thanks for the quick response.  I was using alt-printscreen with word, I'll start using it with paint as you suggested to get screen shots in.

    Thanks for trying the sorting approach on CCS4. I'll just go with the crowd and keep .h files in one subdriectory and .c files in another.  It is a tad annoying that such a basic feature in CodeWrite & CCS 3.3 does not have an equivalent in CCS 4 or 5, but I'll move on... i've got bigger fish to fry.

    Again, thanks for the quick response.

    -Shawn