0

How does one create the equivalent of below in Eclipse with its CDT? Below, there's a "root" project with a main (ConsoleTest) and a couple of libraries (StaticLib and DynamicLib). The root project depends upon both the static library and dynamic library (or shared object).

enter image description here

In Eclipse, its called a "multi module project", but I have not come across documentation of creating it or maintaining it. There are lots of questions on user forums, but little to no useful answers (cf, multi module project site:eclipse.org).

When I attempt to add additional projects with Eclipse, I get the error, /home/jwalton/StaticLib overlaps the location of another project: 'ConsoleTest'. In this case, ConsoleTest is the main project, and StaticLib is a project that I am trying to add.

I know the question is somewhat broad. But I also know there's not "too many good answers" because I've been searching on and off for a couple of days. This question is similar to Building a multi module C project (i.e. solution) with Eclipse CDT, but without the Autotools requirement.

Community
  • 1
  • 1
jww
  • 97,681
  • 90
  • 411
  • 885
  • Not sure if thats feasible for you, but the way I handle such setups is to have different projects in the eclipse workspace, in your case one for "ConsoleTest", one for "DynamicLib" and one for "StaticLib" - the workspace itself would then be the equivalent of the VisualStudio Solution – Andreas Fester Feb 18 '14 at 11:42
  • Thanks Andreas. Perhaps I should back up a bit. Where, precisely, is the project or solution file used by Eclipse? I can't locate it in the project's directory. My thinking is I might be able to add the project by hand and "things will just work" rather than battling the Eclipse UI. – jww Feb 18 '14 at 13:44
  • The project's meta data is stored in the `.project` file in the projects folder, and when using CDT there is an additional `.cproject` file for the C/C++ specific settings. Regarding the error you get: you must not overlap project directories - you should create the three projects in separate directories, like `/home/jwalton/ConsoleTest`, `/home/jwalton/DynamicLib` and `/home/jwalton/StaticLib`. – Andreas Fester Feb 18 '14 at 13:54
  • Thanks Andreas. Double clicking `.cproject` does not open the project in Eclipse. Additionally, moving the project to create the directory structure you describe seems to have blown out Eclipse's settings on the project. Surely this is not meant to be so complex.... – jww Feb 18 '14 at 14:55

0 Answers0