Using Protobuffers (C++) with ESP-IDF

eagi223
Posts: 16
Joined: Fri Mar 02, 2018 4:46 pm

Using Protobuffers (C++) with ESP-IDF

Postby eagi223 » Mon Apr 15, 2019 4:09 pm

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?

eagi223
Posts: 16
Joined: Fri Mar 02, 2018 4:46 pm

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

Postby eagi223 » Fri Apr 19, 2019 11:15 pm

I ended up figuring it out. I posted my solution here: https://stackoverflow.com/questions/556 ... 5#55768815

eagi223
Posts: 16
Joined: Fri Mar 02, 2018 4:46 pm

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

Postby eagi223 » Tue Apr 30, 2019 7:46 pm

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.

Who is online

Users browsing this forum: Baidu [Spider], MicroController and 132 guests