My specific case is that I would like to use the C++ Protobuffer Lib. This is installed locally on my system, but I could also copy the .a file into my project if that made it easier. In the long run, having the library inside the project would probably be better anyway since it wouldn't require other developers on my team to have Protobuffers installed. I thought I would be able to do the following:
1)Write a C++ wrapper that interacted with the library through pure function calls (no public C++ specific features).
2)Link the Library I wanted in the main component.mk file using:
Code: Select all
CXXFLAGS += -I/usr/local/include
Code: Select all
COMPONENT_ADD_LDFLAGS += -lthislibraryiwant
This didn't work at all and I'm sure that it is just me not knowing the correct way to go about it. Adding the CXXFLAGS made it so that headers were being found, but I was getting linking issues with errors saying "Undefined reference to function_name" about a thousand times...
Does anyone have a good example of how you would use a C++ library with C code in the IDF including how to get the component.mk file correct for it?
Thanks in advance!
Ethan