Page 1 of 1

Using Protobuffers (C++) with ESP-IDF

Posted: Mon Apr 15, 2019 4:09 pm
by eagi223
Hi!

I'm trying to use some C++ protobuffer files with my IDF project, but I'm having some issues getting it working. I've generated my test.pb.cc and test.pb.h files using protoc on my test.proto file. When I try to run "make" it fails when compiling test.pb.cc with the following error message:
In file included from /Users/ethan/Documents/Development/project/components/component/test/test/test.cpp:2:0:
/Users/ethan/Documents/Development/project/components/component/test/test/test.pb.h:10:40: fatal error: google/protobuf/port_def.inc: No such file or directory
I'm guessing this is an issue with my component.mk file? I'm not sure how to go about linking the Protobuf library in the component.mk. I got this working in a quick command line program I wrote and the makefile for that used -L ~/usr/local/lib in the LDFLAGS and -lprotobuf in the g++ command. Any ideas?

Re: Using Protobuffers (C++) with ESP-IDF

Posted: Fri Apr 19, 2019 11:15 pm
by eagi223
I ended up figuring it out. I posted my solution here: https://stackoverflow.com/questions/556 ... 5#55768815

Re: Using Protobuffers (C++) with ESP-IDF

Posted: Tue Apr 30, 2019 7:46 pm
by eagi223
Actually, it is NOT working. My fix worked for the issues I was having compiling the headers for Protobuffers, but now I'm getting linking errors with the precompiled library.