How to add an existing file (or files) to a Project?
import -> general [+] from filesystem
copy the files into the directory and refresh the project
You can also make a copy/paste or a drag’n drop directly from the Windows Explorer.
It worked once, but now I can’t get it to work again.
In addition to the usual ‘src’ and ‘inc’ folders, I want to add another folder; say ‘extras’
The Project explorer shows this folder, but doesn’t seem to regard it as part of the project - its icon doesn’t have the little ‘c’ overlay like ‘src’ and 'inc do.
Also, the files in the folder are shown with slightly different icons - the ‘c’ and ‘h’ letters are “outlines” instead of the solid letters in the ‘src’ and ‘inc’ folders.
So what’s going on here? How do I persuade 'Studio that these files not only exist, but are actually to be considered part of the project.
None of the ‘Import’ options above is working - either it just flatly refuses to enable the ‘Next’ button, or it complains that the source is the same as the destination, or somesuch.
BTW: The online help on “Project Explorer View icons” is no help at all - it doesn’t even mention the little ‘c’ overlay on the folder icons, nor the different types of ‘h’ and ‘c’ file icons.
The solution seems to be to go to New > Source Folder in the Project Explorer, and specify the exisiting non-Source folder as the “new” Source Folder! Sounds bizarre, but it seems to work!
Actually, “source folders” are locations where C/C++ files contributing to the project are looked for.
If you simply add a folder… it just adds it, as it would be done in Windows explorer for instance, since “projects” in Eclipse/M2M Studio can be used to store files other than source files…
So the right way is to create a new “Source folder” (without having to create the folder before: it will be obviously implicitely created).
might i ask some questions here ?
where is the destination for the customized header files ?
there are some directories in one’s project explorer, like binaries, includes, src, inc, and itf.
is it allright when i copy some that customized header files to “inc” ?
It would probably have been better to start a new thread specific to your new question.
You can always include a link to another thread if you think it’s relevant…
I think the idea is that inc is for headers that are used internally within the project, and itf is for any “interface” headers that may be required outside the project.
This is just a matter of convention - it doesn’t actually make any difference at all to the tools.