> Petteri
I just added the .options but for some reason the compiler keeps crashing with the same error. So this time I went to the docs (http://jpa.kapsi.fi/nanopb/docs/reference.html#defining-the-options-in-a-options-file) and run the debug command:
$ protoc . --nanopb_out=-v:. message.proto
[libprotobuf WARNING google/protobuf/compiler/parser.cc:546] No syntax specified for the proto file: . Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
protoc-gen-nanopb: program not found or is not executable
--nanopb_out: protoc-gen-nanopb: Plugin failed with status code 1.
That command was run at ~/Docs/libraries/nanopb/projects/tutorial is that messing with something?
It's weird because I do have syntax specified (my proto is attached to the original post). This time I attached my .options along with my Makefile.
Am I missing something too obvious?
Sorry for the trouble.
Tomas
Gave it a clean start and created a new project. Don't know exactly what was the problem but it seems to be working fine now (set back the makefile to the original simple example). I've managed to get the string type working. The only curious thing I've found is that can't seem to encode optional data types. Doesn't matter if it's int32 or string, when I try to code it, they both decode to 0 and "" respectively. Couldn't find anything in the docs.
Oh ok great, I changed the following line:
#define SimpleMessage_init_default {0, true, ""}
That solved the issue.
Thanks!