CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2009
    Posts
    1,689

    Code::Blocks question

    Is there a way to group files together instead of having it use Source and Headers? My current project is 200 files and it would be nice if I could put them inside of groups like in Dev-C++ or XCode. Is there a setting that I'm missing?

  2. #2
    Join Date
    Jan 2009
    Location
    Salt Lake City, Utah
    Posts
    82

    Re: Code::Blocks question

    Just have each source file include all the other source files it requires to function, then use #ifndef to make sure it's only included once
    Intel Core Duo Macbook w/ Mac OS 10.5.6
    gcc 4.2.1 (i386-apple-darwin9.1.0) and Xcode 3.1.1

  3. #3
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: Code::Blocks question

    Quote Originally Posted by ninja9578
    Is there a way to group files together instead of having it use Source and Headers? My current project is 200 files and it would be nice if I could put them inside of groups like in Dev-C++ or XCode. Is there a setting that I'm missing?
    You could try "Add new virtual folder" from the context menu.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  4. #4
    Join Date
    Jan 2009
    Posts
    1,689

    Re: Code::Blocks question

    Quote Originally Posted by laserlight View Post
    You could try "Add new virtual folder" from the context menu.
    Ah, it didn't click what a virtual folder was.

    Quote Originally Posted by Etherous View Post
    Just have each source file include all the other source files it requires to function, then use #ifndef to make sure it's only included once
    Huh?

  5. #5
    Join Date
    Jan 2009
    Location
    Salt Lake City, Utah
    Posts
    82

    Re: Code::Blocks question

    square.h:
    Code:
    #ifndef SQUARE
    #define SQUARE
    #include "shape2d.h"
    class Square : public Shape2d
    {
    ...
    };
    #endif // SQUARE
    cube.h:
    Code:
    #ifndef CUBE
    #define CUBE
    #include "square.h"
    #include "shape3d.h"
    class Cube : public Square, public Shape3d
    {
    ...
    };
    #endif // CUBE
    Last edited by Etherous; April 23rd, 2009 at 03:13 PM.
    Intel Core Duo Macbook w/ Mac OS 10.5.6
    gcc 4.2.1 (i386-apple-darwin9.1.0) and Xcode 3.1.1

  6. #6
    Join Date
    Jan 2009
    Posts
    1,689

    Re: Code::Blocks question

    I'm still confused by what you're showing me, those are classes, they have nothing to do with file groups :?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured