Is there a way to modularize a project with sub-folders?
Posted: Wed May 21, 2008 7:58 am
There was a question on the old project about how to organize large projects, I presume by using sub-folders I have the same questions:
When projects get complicated (like one I'm working on now with ~60 .h and .cpp files in my project), it would be a big help to be able to simplify the project by using sub-folders. I can do this, but so far only if each file's #include statements are very path aware using either relative paths:
#include "..\..\motor.h"
or absolute paths:
#include "C:\\workspace\MyProjA\motors\motor.h"
This makes it a real pain to move code, or modules into new projects because these paths need attention. Even within one project, I find spec'ing all these paths makes it too much trouble to organize with sub-folders.
3 QUESTIONS:
1) Is it possible to configure Eclipse to automatically look for any .h, .c, or .cpp files in any subfolder contained within a project? That way, the project would be organized, but as long as a file were somewhere in the project folder, their paths would not need to be explicitly declared everywhere.
2) I have one instance of Eclipse where the C/C++ Projects View lists a project's files with all the .h files followed by all the .cpp
files. Another instance of Eclipse shows files grouped by name, that is, the .h and .cpp files together. Where do you control this?
3) Finally, how do you make Eclipse show the Settings folder, and the configured Include folders for a given project (or not)?
I'm posting this message on the both the old and new forums to insure the broadest audience: sorry if you get two emails.
The original post was:
///////////////////////////////////////////////////////////////
My first 5213 application has grown to the point where I would like
to "modularize" ( if that's a word ) the code. I haven't been able to
find, or figure out, how to tell the compiler to compile and link
multiple source files.
I've found the ${INPUTS} macro in the C/C++ Build Tool Settings, but
not how to specify the file(s) to use.
Any help would be appreciated.
When projects get complicated (like one I'm working on now with ~60 .h and .cpp files in my project), it would be a big help to be able to simplify the project by using sub-folders. I can do this, but so far only if each file's #include statements are very path aware using either relative paths:
#include "..\..\motor.h"
or absolute paths:
#include "C:\\workspace\MyProjA\motors\motor.h"
This makes it a real pain to move code, or modules into new projects because these paths need attention. Even within one project, I find spec'ing all these paths makes it too much trouble to organize with sub-folders.
3 QUESTIONS:
1) Is it possible to configure Eclipse to automatically look for any .h, .c, or .cpp files in any subfolder contained within a project? That way, the project would be organized, but as long as a file were somewhere in the project folder, their paths would not need to be explicitly declared everywhere.
2) I have one instance of Eclipse where the C/C++ Projects View lists a project's files with all the .h files followed by all the .cpp
files. Another instance of Eclipse shows files grouped by name, that is, the .h and .cpp files together. Where do you control this?
3) Finally, how do you make Eclipse show the Settings folder, and the configured Include folders for a given project (or not)?
I'm posting this message on the both the old and new forums to insure the broadest audience: sorry if you get two emails.
The original post was:
///////////////////////////////////////////////////////////////
My first 5213 application has grown to the point where I would like
to "modularize" ( if that's a word ) the code. I haven't been able to
find, or figure out, how to tell the compiler to compile and link
multiple source files.
I've found the ${INPUTS} macro in the C/C++ Build Tool Settings, but
not how to specify the file(s) to use.
Any help would be appreciated.