Home » Language IDEs » C / C++ IDE (CDT) » multi-platform c++ development
multi-platform c++ development [message #196719] |
Thu, 12 July 2007 17:44  |
Eclipse User |
|
|
|
Originally posted by: dingfelder_nospam.gmail.com
I need to generate a library for multiple platforms: win, linux and mac
I am currently running eclipse on XP and can successfully generate the
dll for windows.
I am moving my development platform to linux.
Assuming that I can get my code to compile there which should not be too
hard, as it is pretty standard, how do I get CDT to generate the library
for all 3 platforms?
|
|
| |
Re: multi-platform c++ development [message #197730 is a reply to message #196850] |
Thu, 19 July 2007 01:11   |
Eclipse User |
|
|
|
Originally posted by: dingfelder_nospam.gmail.com
My make files were autogenerated, but I am open to suggestions on how I
"should" be doing it.
My projects are not too large so I assume I could start from scratch
from a helloworld point of view and then drop in my 5 or 6 cpp files
once I get it working on both windows and linux.
Do you suggest making the makefiles yourself? or can eclipse do it for me?
Ideally, I would set my target to release, and hit build, and it would
generate both the linux and windows exes or libraries.
thoughts?
Jens Seidel wrote:
> dingfelder wrote:
>> I need to generate a library for multiple platforms: win, linux and mac
>>
>> I am moving my development platform to linux.
>>
>> Assuming that I can get my code to compile there which should not be too
>> hard, as it is pretty standard, how do I get CDT to generate the library
>> for all 3 platforms?
>
> Did you write your own makefiles? If this is true it is simple, I would
> (assuming autotools which you probably didn't used in the past for
> simplicity, should work with cmake as well) create different build
> directories with different (cross) compilers:
>
> First create the makefiles or adapt you build system ...
> mkdir build.linux; cd build.linux; CXX=g++-linux ../configure
> mkdir build.macos; cd build.macos; CXX=g++-macos ../configure
>
> Than you could select your makefile targets for the individual build
> directories to create your stuff ...
>
> Jens
>
|
|
|
Re: multi-platform c++ development [message #197764 is a reply to message #197730] |
Thu, 19 July 2007 04:11   |
Eclipse User |
|
|
|
dingfelder wrote:
> My make files were autogenerated, but I am open to suggestions on how I
> "should" be doing it.
There is no proper way to do it but really many ones. I suggest you use
explicitely a build system such as ant, autoconf/automake, cmake,
tmake/qmake but there are many more. cmake is maybe a good candidate (I
don't know it well but KDE uses it).
Using the Eclipse build system will probably never fullfil all your goals,
especially if you want to build the project also without Eclipse (which
requires that some kind of system check is performed, the compiler name and
paths differ across various platforms and should be detected), want to
integrate unit tests, ...
But please be aware that writing your own build system configuration can be
very hard (but should be easy for a trivial hello world example).
> Do you suggest making the makefiles yourself? or can eclipse do it for
> me?
Both is possible, it depends on your requirements. I suggest you try it out,
play a little bit and learn it just for fun. You could also see how other
Open Source projects do it (GNU projects uses always autotools), the source
code of thousands of projects is part of every Linux system, don't know
about cygwin ...
> Ideally, I would set my target to release, and hit build, and it would
> generate both the linux and windows exes or libraries.
At the same time, with one build? This requires very probably manual work,
e.g. the following Makefile stanza:
all: linux win
linux: FORCE
cd build.linux; make all
win: FORCE
cd build.win; make all
FORCE:
Jens
|
|
|
Re: multi-platform c++ development [message #198041 is a reply to message #197764] |
Mon, 23 July 2007 20:26   |
Eclipse User |
|
|
|
Originally posted by: dingfelder_nospam.gmail.com
Thanks for the advise.
I am working through learning cmake, but am finding examples for eclipse
a bit hard to find at the moment.
I do have one example from Mike Jackson that he announced on this board
earlier this week, but it is missing some basic info such as how to
generate the control CMakeLists.txt file.
When I get it working, I will post an update.
Cheers,
Ding
Jens Seidel wrote:
> dingfelder wrote:
>
>> My make files were autogenerated, but I am open to suggestions on how I
>> "should" be doing it.
>
> There is no proper way to do it but really many ones. I suggest you use
> explicitely a build system such as ant, autoconf/automake, cmake,
> tmake/qmake but there are many more. cmake is maybe a good candidate (I
> don't know it well but KDE uses it).
>
> Using the Eclipse build system will probably never fullfil all your goals,
> especially if you want to build the project also without Eclipse (which
> requires that some kind of system check is performed, the compiler name and
> paths differ across various platforms and should be detected), want to
> integrate unit tests, ...
>
> But please be aware that writing your own build system configuration can be
> very hard (but should be easy for a trivial hello world example).
>
>> Do you suggest making the makefiles yourself? or can eclipse do it for
>> me?
>
> Both is possible, it depends on your requirements. I suggest you try it out,
> play a little bit and learn it just for fun. You could also see how other
> Open Source projects do it (GNU projects uses always autotools), the source
> code of thousands of projects is part of every Linux system, don't know
> about cygwin ...
>
>> Ideally, I would set my target to release, and hit build, and it would
>> generate both the linux and windows exes or libraries.
>
> At the same time, with one build? This requires very probably manual work,
> e.g. the following Makefile stanza:
>
> all: linux win
>
> linux: FORCE
> cd build.linux; make all
>
> win: FORCE
> cd build.win; make all
>
> FORCE:
>
> Jens
|
|
| | |
Re: multi-platform c++ development [message #198176 is a reply to message #198114] |
Tue, 24 July 2007 17:03  |
Eclipse User |
|
|
|
Originally posted by: dingfelder_nospam.gmail.com
Thanks Mike.
My main concern at this point is just windows and Linux, although Mac is
desirable as well if possible. And to make things easier, it is just a
(command line) library I am trying to make. (it is currently a windows
c++ dll used for java JNI that I am trying to port to linux)
Cheers,
- Ding
>> Assuming that I can get my code to compile there which should not be
>> too hard, as it is pretty standard, how do I get CDT to generate the
>> library for all 3 platforms?
>
> I am not sure that you can actually generate a binary for OS X on Linux.
> You would need Apple's version of the GCC toolchain, which I think is
> opensourced somewhere. Just FYI. If you really need to do this and your
> program is purely a command line app that will NOT need any type of GUI
> or access to apple specific system calls then you _might_ be able to
> load Darwin on an intel based PC and try your compile then find someone
> who has a mac to test it out.
>
> Just FYI.
>
> Mike
>
|
|
|
Goto Forum:
Current Time: Fri May 09 02:32:03 EDT 2025
Powered by FUDForum. Page generated in 0.03735 seconds
|