Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Mixed project
Mixed project [message #161343] Wed, 04 January 2006 16:50 Go to next message
Alessandro Caproni is currently offline Alessandro CaproniFriend
Messages: 21
Registered: July 2009
Junior Member
Hi all,
I am trying to create an eclipse project for both Java and C++ sources at
the same time.
At the present I have not find any valid solution for that. It seems that
a project can contain only Java o C++ executables, in the sense that I
have the coloured syntax but I have to select one language to have full
functionality on one and only that programming language. For example the
F3 key works for java or for C++ but not for both, depending if I built a
java or a C++ project.

Working with the settings of the project I could easily compile all the
sources with my makefile and my environment and that works.

Can any of you suggest me something to fix this problem?
I have found a lot of info about JDT and C++ but nothing about using both
at the same time...

Ale


Alessandro Caproni
European Southern Observatory (http://www.eso.org)
Re: Mixed project [message #161369 is a reply to message #161343] Wed, 04 January 2006 18:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse.dharty.com

I think the best you'll be able to do is have a workspace that contains
a java project (or projects) and separate c projects. You may also be
able to say that a java project depends on a c project or visa versa,
but that may only work on projects of a similar type; never tried. If
this works, I believe the a call to build the "dependent" project will
attempt to build the dependency as well.

I'm not sure how having a combined Java/C++ project will help you much
anyway? You will need to specify different compilers for each set of
source anyway, which it sounds like you are handling in your makefile
but that still doesn't mean you have one java/c++ application. At best
you'll have two separate applications/libraries that interface with each
other.

If you are using JNI to interface to some C code, then create a c
project for the c jni interface and code and a java project that
"depends" on the c project and it should get built anytime you build the
java project. This seems to make more sense from an architectural level
anyway.

good luck

D


Alessandro wrote:
> Hi all,
> I am trying to create an eclipse project for both Java and C++ sources
> at the same time.
> At the present I have not find any valid solution for that. It seems
> that a project can contain only Java o C++ executables, in the sense
> that I have the coloured syntax but I have to select one language to
> have full functionality on one and only that programming language. For
> example the F3 key works for java or for C++ but not for both, depending
> if I built a java or a C++ project.
>
> Working with the settings of the project I could easily compile all the
> sources with my makefile and my environment and that works.
> Can any of you suggest me something to fix this problem?
> I have found a lot of info about JDT and C++ but nothing about using
> both at the same time...
>
> Ale
>
Re: Mixed project [message #161384 is a reply to message #161369] Thu, 05 January 2006 10:21 Go to previous messageGo to next message
Alessandro Caproni is currently offline Alessandro CaproniFriend
Messages: 21
Registered: July 2009
Junior Member
Hi Dave,
In my system each module can contain three programming languages (yes, we
have also Python) and the dipendence between the languages (if it exists)
is in the sense of CORBA. We do not use JNI.

In eclipse IDE, My makefile handles IDL, java, C++, Python (and also some
XML stuff) correctly.
The problem is that the JDT and CDT seems not to live together so if I
have code completion C++ I don't have it in Java and viceversa.
That's quite boring... and in the same time I do not want to have moltiple
projects for the same module.

Do you think I can write a plugin to fix this problem?
However, I will try if your suggestion work and let you know the results.

Ale


Alessandro Caproni
European Southern Observatory (http://www.eso.org)
Re: Mixed project [message #161409 is a reply to message #161384] Thu, 05 January 2006 16:29 Go to previous messageGo to next message
Alessandro Caproni is currently offline Alessandro CaproniFriend
Messages: 21
Registered: July 2009
Junior Member
Hi again,
it seems that I have found a solution.
What I did was to change the .project adding the C++ natures to the JDT
natures.
Everything seems to work well now. I have to better investigate all the
functionalities of course, but as far as I could see now the project is
complied in all its flavour and I have the outline for C++ and Java
sources and I can also navigate (F3) through the sources.

I will write a plugin to create automatically these kinds of projects.

Ale


Alessandro Caproni
European Southern Observatory (http://www.eso.org)
Re: Mixed project [message #161557 is a reply to message #161343] Tue, 10 January 2006 00:47 Go to previous messageGo to next message
Tom Tromey is currently offline Tom TromeyFriend
Messages: 17
Registered: July 2009
Junior Member
>>>>> "Alessandro" == Alessandro <acaproni@eso.org> writes:

Alessandro> I am trying to create an eclipse project for both Java and
Alessandro> C++ sources at the same time.

I've generally found this to be a weak spot of Eclipse. For GNU
Classpath we simply set it up as a java project and then added our own
builders to run 'make' for the native bits. This is unsatisfying
since it means we aren't getting C indexing and whatnot.

Your approach of editing the .project file seemed kind of dangerous to
me... but if it works, great.

Tom
Re: Mixed project [message #161719 is a reply to message #161557] Thu, 12 January 2006 10:08 Go to previous message
Alessandro Caproni is currently offline Alessandro CaproniFriend
Messages: 21
Registered: July 2009
Junior Member
I don't think it is dangerous. Form the documentation I have read, a
project is defined by its natures (together with some other things) and
what I did was to add some more nature. I had to trik the .project because
there in no tool that allow this at the present.
I am going to write a plugin to authomatize this process for our projects
but I have no idea when I'll have time for that.

Do you have any special reason to say that it is dangerous?

Ale


Alessandro Caproni
European Southern Observatory (http://www.eso.org)
Previous Topic:Add a new item in the menu "project"
Next Topic:jni.h can't be found
Goto Forum:
  


Current Time: Thu Apr 18 21:28:28 GMT 2024

Powered by FUDForum. Page generated in 0.02614 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top