C++ stylistic concerns?

Michael L Torrie torriem at chem.byu.edu
Thu Mar 22 10:28:10 MDT 2007


On Thu, 2007-03-22 at 09:37 -0600, Steve wrote:
> Thats a really good idea.
> Someone emailed me off list and said to try eclipse, since it works
> the same on all platforms.
> Problem is that my linux eclipse project won't compile on Mac or windows
> and vice versa so I'm back to looking for a multiplatform build
> solution, or dealing with 3 different project files again.
> (my test program for the eclipse compile is literally just hello world)
> 
> I've written makefiles by hand before, but I've never tried to create
> autoconf scripts and etc.  Are there any recommendations other than
> man pages (which I've already read, and couldn't quite grok) for where
> to start learning the auto-tools stuff from?

I just hack my autoconf m4 files from other sources usually.  I
sometimes start with a build environment created by kdevelop and then
hack from there.  It's nasty.  I don't recommend it, except that
autoconf makes it relatively easy to cross-compile.  In fact with
autoconf you can have one source tree and then do your configure inside
a subdirectory, allowing you to simultaneously build for multiple
architectures.  When I tweak my sources I go to my win32 build directory
and run make, then to my linux one and run make, etc.

I've heard cmake is a good choice for dealing with multiple
architectures and cross-compiling.

Michael


> 
> On 3/22/07, Michael L Torrie <torriem at chem.byu.edu> wrote:
> > On Wed, 2007-03-21 at 17:59 -0600, Steve wrote:
> > > Oh good because this is turning into a nightmare of various IDE projects.
> > >
> > > Windows... Visual Studio 2k5 Express
> > >
> > > Linux, Code::Blocks (Make was choking at first, but doesn't now due to
> > > the change in layout so I may switch back to makefiles for Linux.
> > >
> > > Mac, XCode (I really, really hate this IDE)
> > >
> > > If you have a good crossplatform development solution I would be much
> > > obliged, since a unified build environment would speed things up
> > > dramatically.
> >
> > I prefer to simply use GCC on all platforms.  I use autoconf usually,
> > but it's a pain.  cmake might be a better tool.  On windows, the msys
> > environment (mingw.org) gives enough of a unixy environment to satisfy
> > most autoconf or other unix-oriented build systems.
> >
> > So normally I use my standard linux tools and then cross-compile for the
> > windows target.  My last project was in Qt, and I hacked the spec file
> > for win32 so it would work on linux, targeting the win32 compiler.  I
> > also recently set up a complete cross-compiling environment that targets
> > OS X from linux.  This made it easy with my Qt project to easily build
> > all three platforms right on my linux box.  Note that my OS X target
> > cross-compiler is PPC and 10.3 currently, but I do have the compilers
> > installed that target both i386 and PPC 10.4, but I need to populate
> > them with the header files and libraries from 10.4. For information on
> > building the win32 cross-compiler, see
> > http://www.torriefamily.org/~torriem/cross and for the Mac OS X
> > cross-compiler (raw compiler with no platform headers or libraries) see
> > http://ranger.befunk.com/fink/darwin-cross/ .  I hope to write up a
> > summary of how to populate the libraries and header files in the
> > darwin-cross system to generate full OS X exes.
> >
> > So in summary, use GCC on all platforms! :)
> >
> > Michael
> >
> >
> > > Thanks!
> > >
> > > On 3/21/07, Brian Hawkins <brianhks at activeclickweb.com> wrote:
> > > > Question:  what build tool(s) are you using on each platform?  The
> > > > reason I ask is that I have one that kicks butt for writing cross
> > > > platform code.
> > > >
> > > > Brian
> > > >
> > > > Steve wrote:
> > > > > Well I think I may have just figured out one reason for not doing it
> > > > > this way.
> > > > > Windows (Visual C++ .net 2005), is completely ignoring the namespace
> > > > > constraint.
> > > > > So my CreateWindow function was being confused by the compiler with
> > > > > Windows own CreateWindow function.  Hence a lot of errors about
> > > > > missing variables.
> > > > > My guess is the compiler is treating the .h file using c syntax rules
> > > > > rather than c++ syntax rules.
> > > > > Changing my .h to a .cpp fixes the issue.
> > > > > Thats a less than optimal solution though :(
> > > > >
> > > > > For what it's worth it's working like a charm on Mac and Linux.
> > > > >
> > > > > On 3/21/07, Michael L Torrie <torriem at chem.byu.edu> wrote:
> > > > >> On Wed, 2007-03-21 at 10:45 -0600, Steve wrote:
> > > > >> > Thus far it's looking to be dual licensed, GPL (free) and
> > > > >> > closed-commercial (fee of some sort)  Other than that I'm not sure and
> > > > >> > don't much care, as long as the check clears :D
> > > > >>
> > > > >> This does make my last comments about OpenGL moot.  I still think they
> > > > >> are way out in left field though.
> > > > >>
> > > > >> >
> > > > >>
> > > > >>
> > > > >>
> > > > >> /*
> > > > >> PLUG: http://plug.org, #utah on irc.freenode.net
> > > > >> Unsubscribe: http://plug.org/mailman/options/plug
> > > > >> Don't fear the penguin.
> > > > >> */
> > > > >>
> > > > >
> > > > > /*
> > > > > PLUG: http://plug.org, #utah on irc.freenode.net
> > > > > Unsubscribe: http://plug.org/mailman/options/plug
> > > > > Don't fear the penguin.
> > > > > */
> > > > >
> > > >
> > > > /*
> > > > PLUG: http://plug.org, #utah on irc.freenode.net
> > > > Unsubscribe: http://plug.org/mailman/options/plug
> > > > Don't fear the penguin.
> > > > */
> > > >
> > >
> > > /*
> > > PLUG: http://plug.org, #utah on irc.freenode.net
> > > Unsubscribe: http://plug.org/mailman/options/plug
> > > Don't fear the penguin.
> > > */
> > >
> >
> >
> > /*
> > PLUG: http://plug.org, #utah on irc.freenode.net
> > Unsubscribe: http://plug.org/mailman/options/plug
> > Don't fear the penguin.
> > */
> >
> 
> /*
> PLUG: http://plug.org, #utah on irc.freenode.net
> Unsubscribe: http://plug.org/mailman/options/plug
> Don't fear the penguin.
> */
> 




More information about the PLUG mailing list