Include another folders into eclipse projects [message #1830587] |
Wed, 29 July 2020 09:02  |
Eclipse User |
|
|
|
Hi, all.
Currently I have 2 eclipse projects (by simplify I called them Proj-A and Proj-B) and they are both compile/build-able, and both projects are in separate workspaces.
Now, I created a new folder, called Common (out from either workspaces, just a new folder) and there are common.c and common.h
Simple illustration of the folder structure as below
<C>
+---Proj-A (workspace)
|
+---Proj-B (workspace)
|
+--- Common +--- common.c
+--- common.h
Can I know if it possible to include source path/library path (C:\Common) from File System into Proj-A and Proj-B and build?
The idea is Common folder will include all the common files that later being used by Proj-A and Proj-B...
Thanks and regards,
Weelian.
|
|
|
Re: Include another folders into eclipse projects [message #1830620 is a reply to message #1830587] |
Wed, 29 July 2020 23:18  |
Eclipse User |
|
|
|
There are a couple of ways to achieve this.
1) link to directory Common in each project
The link can be a system link or an Eclipse simulated link.
The latter is made with File --> New --> Folder
and selecting Link to alternate location under Advanced
Eclipse will then act as if the common code is part of each project.
2) create a common library and link to it in Proj-A and Proj-B
You will need to tell both Proj-A and Proj-B where the common header files are.
This means setting the path to it in Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc.
and, if you are using a managed build,
in the Include settings for each compiler in Project --> Properties --> C/C++Build --> Settings --> Tool Settings tab
|
|
|
Powered by
FUDForum. Page generated in 0.03378 seconds