I'm trying to serialize multiple messages to a file using a protocol buffer - following the implementation shown here - but I am running into a problem whereby I can't access the FileOutputStream
class as defined in <zero_copy_stream_impl.h>
.
According to the API documentation, the FileOutputStream
class is under the namespace google::protobuf::io
- but the only definitions I can see under this namespace are CodedOutputStream
, CodedInputStream
, ZeroCopyOutputStream
, and ZeroCopyInputStream
.
Does anyone have any ideas on how to resolve this? FYI, I'm using Microsoft Visual Studio 2010 with protobuf-2.4.0a build. Here is a snippet of my code and the resulting error messages (Intellisense as well as compiler error):
int outfd = _open(fileName.c_str(), _O_CREAT | _O_BINARY | _O_APPEND | _O_WRONLY);
google::protobuf::io::ZeroCopyOutputStream *output = new google::protobuf::io::FileOutputStream(outfd);
warning C4996: '_open': This function or variable may be unsafe. Consider using _sopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
IntelliSense: expected a type specifier
error C2061: syntax error : identifier 'FileOutputStream'
error C2039: 'FileOutputStream' : is not a member of 'google::protobuf::io'