#include <google/protobuf/io/coded_stream.h>
namespace google::protobuf::io
....
int fd = open("myfile", O_WRONLY);
ZeroCopyOutputStream* raw_output = new FileOutputStream(fd);
CodedOutputStream* coded_output = new CodedOutputStream(raw_output);
以上是繼教程here,但是當我編譯得到以下錯誤:錯誤使用時,谷歌的protobuf的
error C2061: syntax error : identifier 'io'
什麼可以錯在這裏?
UPDATE
當我改變了上面using namespace google::protobuf::io;
我得到一個新的錯誤說符號FileOutputStream
沒有定義,怎麼來的?
謝謝男人!在這個變化之後,我得到一個新的錯誤,怎麼回事? – user198729 2010-08-26 14:30:56
爲什麼頂部的代碼段僅用於該頭部,而教程依賴於整個庫。你只是複製和粘貼代碼而不理解它。我不打算坐在這裏,調試你可能遇到的每一個錯誤。 – Puppy 2010-08-26 15:01:39