Nov 23, 2009

Organizing C++ Project Files For Large Projects - (source code, header, makefiles)

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Programming > Programming General > C, C++ & Visual C++

Organizing C++ Project Files For Large Projects - (source code, header, makefiles)

Vyoma
Is there any online resource or documentation I can look at, which gives standards or best-practices in terms of organizing the source code for C++ projects?

My day job has kept me away from C++ and into Java for quite some time now, and I see there has been a lot of work in terms of standardizing C++ during that time.

To illustrate, looking up Sun's documentation, I know that I should put my Java projects (for POJOs) as follows:
/src - source files ( containing more subfolder like /src/com/example for namespace of com.example.*)
/build - intermediate files used by Ant build.xml
/cfg - configuration and .property files
/lib - any third-party libraries used
/scripts - invokers for Linux/Unix boxes

Is there any similar standard being followed for C++ projects? I am thinking of working on a Gtkmm based project, and if my prototyping gives good results, I would put it out as OpenSource (GPL perhaps). Since it could potentially be used and developed upon by others, I want to make sure I follow the standards and do not do a bad start.

 

 

 


Comment/Reply (w/o sign-up)

yordan
Everything is inside the makefile (or Makefile) file.
There are mainly "best practices" everybody know, and each time I have to put my nose inside I say "why did he not do like me ?"
However, I would say it differently :
- not /src, but /home/mythings/src
I would like to suggest you to see how a well-known opensource software distro is organized.
Have a look at imagemagick instructions here : http://www.imagemagick.org/script/install-source.php#unix
and download their source distro from here http://www.imagemagick.org/script/download.php
Download the source, and see how it's organized, and have a look at the makefile.
The best thing is to organize it the same way, in such a way that you simply have to untar, then make, and make install, and in case of error "make clean".

Comment/Reply (w/o sign-up)

Vyoma
Ayaaa! I think I wrote it wrongly when I was showing what I was doing with my Java projects. When I said /src, I should have actually said, '/my-home-folder-path/java-workspace/specific-project/src'. Instead of '/lib', I should have said, '/my-home-folder-path/java-workspace/specific-project/lib' and so on. tongue.gif

Hmmm - I think I will do that. Thanks for the imagemagick link. May be I will check out some other OpenSource projects too which are implemented in C++ (know of any?).

Comment/Reply (w/o sign-up)

yordan
QUOTE(Vyoma @ Nov 28 2008, 06:23 PM) *
May be I will check out some other OpenSource projects too (know of any?).

Have a look at PostGreSQL, it's a nice implementation. I don't remember whether it's C or C++, but from the implementation point of view it's very nice.
For instance I appreciate the fact that the final test says "Sorry, you are the root user, you should not" and you simply have to restart everything as a standard Unix user ! laugh.gif

Comment/Reply (w/o sign-up)

yordan
Also have a look at httrack. It's a gnu licensed program, and the cpp source files are distributed inside the Crosoft Dodows end-users version.

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : organizing, c, project, files, large, projects, source, code, header, makefiles,

  1. Friends Can't Start The Exe Files I Send :(
    (5)
  2. Free Source Codes For C++
    (1)
    Hey, just posting some exercises from Chapter 4 of the old book. CODE /* Chapter 4 Exercise
    11a by Albert Villaroman 11-27-06 */ #include int main () {     cout         int u;         cin
    >>u;     while (u         cout           cin >>u;     }          int potentialPrimes=0, loops=0;
        for (int f=2; f         if (u%f != 0) {             potentialPrimes++;         }
            loops++;     }          if (potentialPrimes == loops)         cout     else         cout
                  return(0); } /* Chapter 4 Exercise 11b by Albert Villaroman 11-27-06 */ #....
  3. How To Get The Random.h Header
    (4)
    Hi, I'm currently looking for a header file I really need. It's a random.h header file. Is
    there a way that someone can send it to me? I know there is a rand() function in stdlib.h but I
    prefer to use the random.h one because it's being used for my school.....
  4. Interested In Compression Algorithms?
    Here you have a cute code! (5)
    That's a compressor i made during my university practical lessons on information theory,
    it's a text compressor, it's only usefull for texts containing only vocals, but it can
    easily be adapted for the whole alphabet ^^... Good luck with the comment translation!! (Catalan
    and Spanish...) #include #include #include //En argv tenemos: (1)selector de
    compresion/descompresion (2)Tabla de frecuencias (3)Fichero de simbolos // (4)Fichero de salida int
    treureDigitsCodificacio (int*,int*,FILE*,FILE*,int*,int*); void calcularAltBaix
    (int*,int*,int*,int,FILE*....
  5. Programing Windows Joystick
    Questions about windows joystick code (2)
    I have 2 joystick related questions. The first is, does anyone know if there is a driver that will
    allow me to use my joystick (actually 12button/3axis gamepad) to control my mouse pointer in
    windows95? I have one program that will allow me to do that (very indirectly) using windows
    accessability & the program that camewith my joystick. But it is exceedingly slow, because it uses 2
    forms of redirection. First it translates joystick movements to key presses (slow), then I use the
    windows accessability to translate that to mouse movements. But that is so slow, it's pr....

    1. Looking for organizing, c, project, files, large, projects, source, code, header, makefiles,

See Also,

*SIMILAR VIDEOS*
Searching Video's for organizing, c, project, files, large, projects, source, code, header, makefiles,
advertisement



Organizing C++ Project Files For Large Projects - (source code, header, makefiles)

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com