From ross at biostat.ucsf.edu  Fri Feb  9 00:30:36 2007
From: ross at biostat.ucsf.edu (Ross Boylan)
Date: Thu, 8 Feb 2007 15:30:36 -0800
Subject: [Rd] Problem using ofstream in C++ class in package for MacOS X
In-Reply-To: <45CBA9E1.6060400@aon.at>
References: <45C6315F.9020209@aon.at>
	<17862.14169.654577.51179@basebud.nulle.part>
	<45C6400A.3050700@aon.at> <m2d54pob4f.fsf@fhcrc.org>
	<45C65479.30906@aon.at>
	<20070208203245.GA6397@wheat.betterworld.us>
	<45CB904E.1020300@aon.at>
	<20070208221450.GI5871@wheat.betterworld.us>
	<45CBA9E1.6060400@aon.at>
Message-ID: <20070208233036.GK5871@wheat.betterworld.us>

On Thu, Feb 08, 2007 at 11:53:21PM +0100, cstrato wrote:
...
> >Maybe there's some subtle linker problem, or a problem with the
> >representation of strings
> >
> >
> >  
> What do you mean with linker problem?
> 
Nothing very specific, but generically wrong options, wrong
objects/libraries, or wrong order of the first 2.  "Wrong" includes
omitting something that should be there or including something that
shouldn't.

Linking on OS-X is unconventional relative to other systems I have
used.  In particular, one usually gets lots of errors about duplicate
symbols (which can be turned off, at some risk) and needs to specify
flat rather than 2-level namespace.  There's lots more if you look at
the linker page (man ld).

Similar issues can arise at the compiler phase too.

Another fun thing on OS-X is that they have a libtool that is
different from the GNU libtool, and your project might use both.  So
you need to be sure to get the right one.  But it's unlikely you could
even build if that were an issue.

If different parts (e.g., R vs your code) are built with different
options, that can cause trouble.

For example, my Makefile has
MAINCXXFLAGS :=  $(shell R CMD config --cppflags) -std=c++98 -Wall -I$(TRUESRCDIR)
This relies on GNU make features.



[Rd] Problem using ofstream in C++ class in package for MacOS X
Ross Boylan