Hi Rob,

That's a strange one.

Would you be able to try modifying the order of the includes in dump.cpp
to:

#include <string>
#include <sstream>
#include <iomanip>

#include <R.h>
#include <Rdefines.h>

then try doing a source install/compile

I suspect that the #define length(x)        Rf_length(x) from Rinternals.h
might be making it's way into stdlib sstream.

Please let me know if this fixes the problem, and I could then upload a new
version for this bug.

Thanks for the report.
Alex

On Sun, Mar 18, 2012 at 9:34 AM, Robert J Goedman <goedman@mac.com> wrote:

> Alex,
>
> I noticed rjson (v 0.2.7) does not compile (see below messages) on my
> system. I always install from source and the R 2.15 library directory shows
> I installed rjson 0.2.6 on 10/18/11.
>
> This seems deep inside Mac OS X, just wondering if you'd seen this.
>
> Regards,
> Rob
>
>
> On Mar 16, 2012, at 5:55 AM, Prof Brian Ripley wrote:
>
>
> Perhaps this can encourage people to test 2.15.0 beta?  Its binary package
> repository does have a populated PACKAGES file.
>
>
> * installing *source* package ‘rjson’ ...
> ** package ‘rjson’ successfully unpacked and MD5 sums checked
> ** libs
> *** arch - x86_64
> g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include
> -I/Library/Frameworks/R.framework/Resources/include/x86_64
> -DNDEBUG  -I/usr/local/include    -fPIC  -g -O2  -c dump.cpp -o dump.o
> In file included from /usr/include/c++/4.2.1/bits/locale_facets.h:1539,
>                  from /usr/include/c++/4.2.1/bits/basic_ios.h:44,
>                  from /usr/include/c++/4.2.1/ios:50,
>                  from /usr/include/c++/4.2.1/istream:44,
>                  from /usr/include/c++/4.2.1/sstream:44,
>                  from dump.cpp:5:
> /usr/include/c++/4.2.1/bits/codecvt.h:219:45: error: macro "length" passed
> 4 arguments, but takes just 1
> In file included from /usr/include/c++/4.2.1/bits/locale_facets.h:1539,
>                  from /usr/include/c++/4.2.1/bits/basic_ios.h:44,
>                  from /usr/include/c++/4.2.1/ios:50,
>                  from /usr/include/c++/4.2.1/istream:44,
>                  from /usr/include/c++/4.2.1/sstream:44,
>                  from dump.cpp:5:
> /usr/include/c++/4.2.1/bits/codecvt.h:218: error: expected ‘;’ before
> ‘const’
> /usr/include/c++/4.2.1/bits/codecvt.h:222: error: expected `;' before ‘int’
> make: *** [dump.o] Error 1
> ERROR: compilation failed for package ‘rjson’
> * removing ‘/Users/rob/Library/R/2.15/library/rjson’
> * restoring previous ‘/Users/rob/Library/R/2.15/library/rjson’
>
> ----------------------------------------------------------
>
> Package: rjson
> Version: 0.2.7
> Date: 2012-03-13
> Title: JSON for R
> Author: Alex Couture-Beil <rjson_pkg@mofo.ca>
> Maintainer: Alex Couture-Beil <rjson_pkg@mofo.ca>
> Depends: R (>= 2.12.0)
> Description: Converts R object into JSON objects and vice-versa
> License: GPL-2
> Repository: CRAN
> Date/Publication: 2012-03-14 06:18:06
> Packaged: 2012-03-14 04:58:09 UTC; alex
>
> -------------------------------------------------------------
>
> > sessionInfo()
> R version 2.15.0 beta (2012-03-17 r58784)
> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] Rcpp_0.9.10  tools_2.15.0
>
>
> > R.version
>                _
> platform       x86_64-apple-darwin9.8.0
> arch           x86_64
> os             darwin9.8.0
> system         x86_64, darwin9.8.0
> status         beta
> major          2
> minor          15.0
> year           2012
> month          03
> day            17
> svn rev        58784
> language       R
> version.string R version 2.15.0 beta (2012-03-17 r58784)
>
>

	[[alternative HTML version deleted]]

