Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Referencing other projects does nothing?(How to properly include files from another projects?)
Referencing other projects does nothing? [message #677211] Tue, 07 June 2011 16:34 Go to next message
eight  is currently offline eight
Messages: 27
Registered: June 2011
Junior Member
The CDT help says somethig to the effect, that referencing other projects will make their files automatically accessible to the current project. I interpret this that if a project is referenced, the user does not have to go through a trouble of adding the referenced projects' dependencies by hand to the current project.

However referencing other projects seems to do nothing vis-a-vis their includes and libraries.

What is the proper way to do this?

Thanks.


--8
Re: Referencing other projects does nothing? [message #677390 is a reply to message #677211] Wed, 08 June 2011 07:41 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
Project Properties->C/C++ General->Export Settings

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Referencing other projects does nothing? [message #681873 is a reply to message #677390] Thu, 09 June 2011 21:54 Go to previous messageGo to next message
eight  is currently offline eight
Messages: 27
Registered: June 2011
Junior Member
Yes, that is a necessary part of referencing projects, the question stands.
Re: Referencing other projects does nothing? [message #681968 is a reply to message #681873] Fri, 10 June 2011 02:57 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
Quote:
The CDT help says somethig to the effect, that referencing other projects will make their files automatically accessible to the current project.

No. Referencing means that the referenced project will be build when the original project is build. Exporting symbols is something else (see my last comment).


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Referencing other projects does nothing? [message #682118 is a reply to message #681968] Fri, 10 June 2011 08:55 Go to previous messageGo to next message
eight  is currently offline eight
Messages: 27
Registered: June 2011
Junior Member
Let me rephrase the question: how one includes the source files and links the libraries from another project as a group, without copying that project's files into the current project, or without enumerating each of them. I call this "referencing another project", regardless of what other meaning there might be.

Thanks.

--8

[Updated on: Fri, 10 June 2011 08:57]

Report message to a moderator

Re: Referencing other projects does nothing? [message #683760 is a reply to message #682118] Tue, 14 June 2011 07:34 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
eight wrote on Fri, 10 June 2011 14:55
Let me rephrase the question: how one includes the source files and links the libraries from another project as a group, without copying that project's files into the current project, or without enumerating each of them. I call this "referencing another project", regardless of what other meaning there might be.

Thanks.

--8

Let me rephrase my answer
Project Properties->C/C++ General->Export Settings

Everything is explained here:
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.cdt.doc.user/tasks/cdt_t_proj_referenced_configs.htm


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Referencing other projects does nothing? [message #684643 is a reply to message #683760] Wed, 15 June 2011 20:59 Go to previous messageGo to next message
eight  is currently offline eight
Messages: 27
Registered: June 2011
Junior Member
Ah, thanks, I should have put that link in the first place. This brings us back to the issue. Let me be as concrete as possible.

There are two projects EightPlusPlusApp and EightPlusPlusParser. EightPlusPlusParser wants to include a ITracker.h from the EightPlusPlusApp project.

First this EightPlusPlusParser project says it references EightPlusPlusApp project like this:


index.php/fa/3048/0/


EightPlusPlusApp says it exports its entire src directory, which contains the said ITracker.h file:

index.php/fa/3045/0/

When the EightPlusPlusParser is built, it triggers the EightPlusPlusApp to build, so I assume that referencing at least partially works. However the compiler still cannot find the said ITracker.h:


index.php/fa/3046/0/

This is what I mean by saying "referencing other projects does nothing".

Thanks for looking into this, your help is appreciated.


--8

[Updated on: Wed, 15 June 2011 21:04]

Report message to a moderator

Re: Referencing other projects does nothing? [message #684743 is a reply to message #684643] Thu, 16 June 2011 03:00 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
Thanks for the detailed description. That helped a lot. In your EightPlusPlusParser project you must open Project Properties->C/C++ General and in the tab "References" you must select your EightPlusPlusApp project. This will then automatically add the EightPlusPlusApp include paths (see the Include tab).
The Project References on the first page of the Project Properties are "platform properties" and do know nothing about C/C++ projects. They are only important for the build order.
I think this is all correctly described in the help page. Nevertheless I must admit the double usage of project references is confusing.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Referencing other projects does nothing? [message #684997 is a reply to message #684743] Thu, 16 June 2011 11:32 Go to previous messageGo to next message
eight  is currently offline eight
Messages: 27
Registered: June 2011
Junior Member
Thanks a lot. For the record:

Project Properties -> C/C++ General -> Path and Symbols -> References

does it!

--8
Re: Referencing other projects does nothing? [message #685662 is a reply to message #684743] Fri, 17 June 2011 22:56 Go to previous messageGo to next message
eight  is currently offline eight
Messages: 27
Registered: June 2011
Junior Member
Hi Axel,

Thanks to you, I got further away, but not to the finish line yet -- linking is still a problem. The referred project makes *.h and *.cpp files available to the main project via the export setting. The main project's build triggers the build of the referred project, which produces *.o files in a directory like REFERRED_PROJECT_LOCATION/Default/src (this is on OS X), of which the main project is not aware, and although it compiles, linking fails due to Undefined symbols (residing in the said object files).


Thanks again.


--8

Re: Referencing other projects does nothing? [message #685663 is a reply to message #684743] Fri, 17 June 2011 22:56 Go to previous messageGo to next message
eight  is currently offline eight
Messages: 27
Registered: June 2011
Junior Member
Hi Axel,

Thanks to you, I got further away, but not to the finish line yet -- linking is still a problem. The referred project makes *.h and *.cpp files available to the main project via the export setting. The main project's build triggers the build of the referred project, which produces *.o files in a directory like REFERRED_PROJECT_LOCATION/Default/src (this is on OS X), of which the main project is not aware, and although it compiles, linking fails due to Undefined symbols (residing in the said object files).


Thanks again.


--8

Re: Referencing other projects does nothing? [message #685664 is a reply to message #684743] Fri, 17 June 2011 22:56 Go to previous messageGo to next message
eight  is currently offline eight
Messages: 27
Registered: June 2011
Junior Member
Hi Axel,

Thanks to you, I got further away, but not to the finish line yet -- linking is still a problem. The referred project makes *.h and *.cpp files available to the main project via the export setting. The main project's build triggers the build of the referred project, which produces *.o files in a directory like REFERRED_PROJECT_LOCATION/Default/src (this is on OS X), of which the main project is not aware, and although it compiles, linking fails due to Undefined symbols (residing in the said object files).


Thanks again.


--8

Re: Referencing other projects does nothing? [message #685665 is a reply to message #684743] Fri, 17 June 2011 22:57 Go to previous messageGo to next message
eight  is currently offline eight
Messages: 27
Registered: June 2011
Junior Member
Hi Axel,

Thanks to you, I got further away, but not to the finish line yet -- linking is still a problem. The referred project makes *.h and *.cpp files available to the main project via the export setting. The main project's build triggers the build of the referred project, which produces *.o files in a directory like REFERRED_PROJECT_LOCATION/Default/src (this is on OS X), of which the main project is not aware, and although it compiles, linking fails due to Undefined symbols (residing in the said object files).


Thanks again.


--8

Re: Referencing other projects does nothing? [message #685743 is a reply to message #685665] Sat, 18 June 2011 20:18 Go to previous messageGo to next message
eight  is currently offline eight
Messages: 27
Registered: June 2011
Junior Member
After hours of mindless google, found this "solution": http://www.eclipse.org/forums/index.php/m/112744/?srch=object+files#msg_112744 whereby object files are explicitly referenced through

Project->Properties->C/C++ Build->Settings->MacOS X C++ linker -> Miscellaneous -> Other Objects.

But this almost defeats the purpose of project referencing, isn't it? I could have simply defined my referenced objects as extern, instead of going through a trouble of referencing/exporting them?

--8
Re: Referencing other projects does nothing? [message #685752 is a reply to message #685743] Sun, 19 June 2011 05:40 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
What type is your referenced project? Does it build a library (static or shared)?

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Referencing other projects does nothing? [message #689137 is a reply to message #685752] Sun, 26 June 2011 19:31 Go to previous message
eight  is currently offline eight
Messages: 27
Registered: June 2011
Junior Member
At the moment it is executable. Due to this issue, I am thinking of extracting from it a piece that would build a static library, and make the rest into a CUTE test (since the executable part of it was only to test the shared part). However, I am bit hesitant to go that route, since it still will require referencing the static library using some mechanism, not supported by the refer/export facility in CDT.

Previous Topic:Display as array trouble in Indigo
Next Topic:Output Location tab missing
Goto Forum:
  


Current Time: Tue Jul 29 23:01:31 EDT 2014

Powered by FUDForum. Page generated in 0.13819 seconds