#error regenerate .c/.c files error

318 views
Skip to first unread message

Hardik Senjaliya

unread,
Apr 22, 2021, 4:29:21 AM4/22/21
to nanopb
Hi, 
I am completely new to protobuf/nanopb.

I am trying to generate .c/.h files from .proto file and running into this error:

Error logs:
Error: In file included from lib/protobuf/nanopb/src/ts_ble_module.pb.c:4:
lib/protobuf/nanopb/src/ts_ble_module.pb.h:10:2: error: #error Regenerate this file with the current version of nanopb generator.
10 | #error Regenerate this file with the current version of nanopb generator.
| ^~~~~
lib/protobuf/nanopb/src/ts_ble_module.pb.c:8:2: error: #error Regenerate this file with the current version of nanopb generator.
8 | #error Regenerate this file with the current version of nanopb generator.
| ^~~~~
ts_ble_module.pb.o: lib/protobuf/nanopb/src/ts_ble_module.pb.c \
lib/protobuf/nanopb/src/ts_ble_module.pb.h

This used to work fine without any issues few days ago when I started.

My Environment:
  • nanopb : 0.3.9.6
  • python -V
    • Python 2.7.16
  • python3 --version
    • Python 3.8.6
  • protoc --version
    • libprotoc 3.12.3
  • brew info protobuf
    • protobuf: stable 3.14.0 (bottled), HEAD
Please let me know if I can provide anything more.

Thank you!

Petteri Aimonen

unread,
Apr 22, 2021, 4:32:55 AM4/22/21
to nan...@googlegroups.com
Hi,

> 10 | #error Regenerate this file with the current version of nanopb generator.
> *This used to work fine without any issues few days ago when I started.*

This error means that the generator version that made the .pb.c/.pb.h
files does not match the version of the pb.h header.

You can check the generated file, it will have e.g.
#if PB_PROTO_HEADER_VERSION != 30
for nanopb 0.3.x series.

And the pb.h file in your nanopb directory similarly has the version
specification. Most likely you have a 0.4.x version generator with 0.3.x
version library.

--
Petteri

Hardik Senjaliya

unread,
Apr 22, 2021, 4:36:04 AM4/22/21
to nanopb
Hi Petteri,

Thanks a lot for prompt reply. Sorry I forgot to mention above that error is there even though pb.h file has #define PB_PROTO_HEADER_VERSION 30

Screen Shot 2021-04-22 at 1.35.55 AM.png

--
Hardik

Hardik Senjaliya

unread,
Apr 22, 2021, 4:03:45 PM4/22/21
to nanopb
Hi,

I tried latest nanopb 0.4.5 with protoc 3.15.8, protobuf 3.12.2 and still getting the same error. 
Reply all
Reply to author
Forward
0 new messages