aakash-sahai / nanopb

Automatically exported from code.google.com/p/nanopb
zlib License
0 stars 0 forks source link

Generated foo.bp.h includes "google/protobuf/descriptor.pb.h" #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
After upgrading from nanopb-0.1.1 to nanopb-0.1.2, generated foo.bp.h includes 
"google/protobuf/descriptor.pb.h":

#include "google/protobuf/descriptor.pb.h"

descriptor.pb.h (which is in protobuf) includes <string> -- C++ file. This 
breaks the build process. Manually removing line #include 
"google/protobuf/descriptor.pb.h" seems to fix the problem. Is this include 
really needed, since it's supposed to be clean C build?

Original issue reported on code.google.com by pat...@prezu.one.pl on 12 Jun 2012 at 9:38

GoogleCodeExporter commented 9 years ago
This is related to issue #4.

Do you happen to include google/protobuf/descriptor.proto from your .proto file?

If you do, the easiest fix will be to add 'google/protobuf/descriptor.proto' to 
the exclusion list on line 445 in nanopb_generator.py.

Original comment by Petteri.Aimonen on 12 Jun 2012 at 9:50

GoogleCodeExporter commented 9 years ago
Yes, I did include it and your workaround fixed the problem. :) Thanks.

Original comment by pat...@prezu.one.pl on 12 Jun 2012 at 1:34

GoogleCodeExporter commented 9 years ago
Fixed by revision 5af2c97ecd71

Original comment by Petteri.Aimonen on 13 Jun 2012 at 5:03