Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » cross-platform Eclipse C++ projects
cross-platform Eclipse C++ projects [message #211405] Sun, 09 March 2008 14:07 Go to next message
Ákos Maróy is currently offline Ãkos MaróyFriend
Messages: 2
Registered: July 2009
Junior Member
I'm trying to create a cross-platform C++ development environment, that
needs to work on Linux, MacOS and Windows. I'm considering using Eclipse
C++, after all, it's cross-patform as it is.

But I'm having problems re-using Eclipse projects created among the
platforms. For one, they actually contain a specific reference to the
toolchain used (like Linux GCC - that won't work MacOS or Windows, and
vice versa). Also, on different platform one needs different compiler and
linker options as well.

Of course, one could just create an Eclipse project for each target
platform, but then a lot of stuff has to be duplicated, like when adding
new files, libraries, all of them have to be updated manually.

Is there a solution to the above issue?

Thanks,


Akos
Re: cross-platform Eclipse C++ projects [message #211467 is a reply to message #211405] Mon, 10 March 2008 01:39 Go to previous messageGo to next message
Jonathan Bastnagel is currently offline Jonathan BastnagelFriend
Messages: 2
Registered: July 2009
Junior Member
I've also been having the same issue but decided to simply use separate
IDEs off of the same code base. It's not too much of an issue. I do all of
my coding in Eclipse on Linux. When I need to test something I just pop
open a VM session and compile and test the code in Visual Studio.

If you or anyone finds an elegant solution to this problem please let us
know ;).
Re: cross-platform Eclipse C++ projects [message #211516 is a reply to message #211405] Mon, 10 March 2008 09:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Axel.Howind.htp-tel.de

Hi,

to use the same project on different platforms, I find it most
convenient to set platform dependent settings as global (-> workspace)
settings.

If for example, I want to set include and library paths for libraries
that are installed on the system, I open the "Window / Preferences"
dialog and set CPATH and LIBRARY_PATH under "C/C++ / Environment" to
point to my boost/wxwidgets/openssl/whatever directories.

This won't solve all platform related problems, but saves a lot of
typing since you don't have to addjust these settings for each project.
Only the -l switches (which libraries to link) have to be specified on a
project basis -- well, if they're always the same, you could probably
set an environment variable for these as well (DEFAULT_LIBS="-lxyz -l
abc") and add that one to your toolchains link command...

Axel


Akos Maroy schrieb:
> I'm trying to create a cross-platform C++ development environment, that
> needs to work on Linux, MacOS and Windows. I'm considering using Eclipse
> C++, after all, it's cross-patform as it is.
>
> But I'm having problems re-using Eclipse projects created among the
> platforms. For one, they actually contain a specific reference to the
> toolchain used (like Linux GCC - that won't work MacOS or Windows, and
> vice versa). Also, on different platform one needs different compiler
> and linker options as well.
>
> Of course, one could just create an Eclipse project for each target
> platform, but then a lot of stuff has to be duplicated, like when adding
> new files, libraries, all of them have to be updated manually.
>
> Is there a solution to the above issue?
>
> Thanks,
>
>
> Akos
>
>
Re: cross-platform Eclipse C++ projects [message #211566 is a reply to message #211516] Mon, 10 March 2008 17:53 Go to previous messageGo to next message
Ákos Maróy is currently offline Ãkos MaróyFriend
Messages: 2
Registered: July 2009
Junior Member
Yes, I was also thinking about the same approach - to use variables in
Eclipse that is defined for the workspace, and not for the project. But I
wonder if this all works, for example if you can defined to toolchain
itself like that.

Another approach I'll try to investigate is to use cmake with Eclipse:
http://www.cmake.org/Wiki/CMake:Eclipse

But, in general, as Eclipse is a cross-platform IDE, it would be good to
have real cross-platform support. Like when using Eclipse to develop Java
applications, one can use the same Eclipse project among various platforms
without any problems.

It would be good to have a same when developing C++ in Eclipse as well.
Re: cross-platform Eclipse C++ projects [message #211656 is a reply to message #211566] Tue, 11 March 2008 10:44 Go to previous message
Eclipse UserFriend
Originally posted by: Axel.Howind.htp-tel.de

Setting up your project as standard make is an alternative: cdt does not
distinguish toolchains for standard make.

Easiest way for standard make projects should be installing mingw, bash,
and make (in C:\bin\mingw32) and having this make.bat in your path:

@echo off
SET PATH=%PATH%;C:\bin\MinGW\bin
SET CPATH=C:\bin\boost_1_34_1\
bash -i -c "mingw32-make.exe %1 %3 %4 %5 %6 %7 %8"

For the default managed make, a per workspace toolchain setting and an
option "Use System default toolchain" in the project settings would be nice.

Axel

Akos Maroy schrieb:
> Yes, I was also thinking about the same approach - to use variables in
> Eclipse that is defined for the workspace, and not for the project. But
> I wonder if this all works, for example if you can defined to toolchain
> itself like that.
>
> Another approach I'll try to investigate is to use cmake with Eclipse:
> http://www.cmake.org/Wiki/CMake:Eclipse
>
> But, in general, as Eclipse is a cross-platform IDE, it would be good to
> have real cross-platform support. Like when using Eclipse to develop
> Java applications, one can use the same Eclipse project among various
> platforms without any problems.
>
> It would be good to have a same when developing C++ in Eclipse as well.
>
Previous Topic:cdt+uniwin generates 0 bytes output file!
Next Topic:gcc arguments
Goto Forum:
  


Current Time: Fri Oct 18 13:29:17 GMT 2024

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

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

Back to the top