[Rprotobuf-yada] skeletic implementation of proto messages using external pointers

Romain Francois romain.francois at dbmail.com
Thu Oct 29 12:57:16 CET 2009


On 10/29/2009 12:43 PM, Romain Francois wrote:
> On 10/29/2009 12:31 PM, Dirk Eddelbuettel wrote:
>> On 29 October 2009 at 11:38, Romain Francois wrote:
>> | On 10/29/2009 11:21 AM, Dirk Eddelbuettel wrote:
>> |>   Very nice!
>> |
>> | I'll be nicer when there is some actual code, at the moment I'm juggling
>> | with nil external pointers and R_NilValue, etc ...
>>
>> Hehe.
>>
>> | Quick question, I want to include some header files from libproto, so
>> | something like this is=n my rprotobuf.h
>> |
>> | #include<google/protobuf/compiler/importer.h>
>> |
>> | but I get this :
>> |
>> | protoc --cpp_out=. addressbook.proto
>> | g++ -c addressbook.pb.cc -fpic -shared
>> | -I/usr/local/lib/R/library/Rcpp/lib -I/usr/include
>> | g++ -I/usr/local/lib/R/include -I/usr/local/lib/R/library/Rcpp/lib
>> | -I/usr/include -I/usr/local/include    -fpic  -g -O2 -c
>> | list_people_R.cpp -o list_people_R.o
>> | g++ -I/usr/local/lib/R/include -I/usr/local/lib/R/library/Rcpp/lib
>> | -I/usr/include -I/usr/local/include    -fpic  -g -O2 -c rprotobuf.cpp -o
>> | rprotobuf.o
>> | In file included from /usr/include/google/protobuf/descriptor.pb.h:24,
>> |                   from /usr/include/google/protobuf/compiler/parser.h:46,
>> |                   from /usr/include/google/protobuf/compiler/importer.h:47,
>> |                   from rprotobuf.h:14,
>> |                   from rprotobuf.cpp:3:
>> | /usr/include/google/protobuf/extension_set.h:378: error: expected
>> | identifier before ‘(’ token
>> | /usr/include/google/protobuf/extension_set.h:378: error: ‘parameter’
>> | declared as function returning a function
>> | /usr/include/google/protobuf/extension_set.h:378: error: expected ‘)’
>> | before ‘,’ token
>>
>> Line 378 is part of a large comment block for me :-/
>>
>> Which version?  I have Debian's 2.1 of ProtoBuf.
>>
>> Sametime #defines in R clash.  I'll try to take a look later but no promises.
>
>
> $ yum provides protobuf
>
> ...
>
> protobuf-2.2.0-2.fc11.i586 : Protocol Buffers - Google's data
> interchange format
> Repo        : installed
> Matched from:
> Other       : Provides-match: protobuf
>
> Line 378 is the middle line of :
>
>       int GetSize() const;
>       void Free();
>       int SpaceUsedExcludingSelf() const;
>
> I'll keep looking

Strange thing. If I put the google includes first, it works. I guess 
there is a lot of non standard things in R headers.

And now for some fun ...


-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/BcPw : celebrating R commit #50000
|- http://tr.im/ztCu : RGG #158:161: examples of package IDPmisc
`- http://tr.im/yw8E : New R package : sos



More information about the Rprotobuf-yada mailing list