#Interop with external C/C++ libraries

1 messages · Page 1 of 1 (latest)

stoic narwhal
#

Hello, I made an interop library to add to the nanoframework image and it works fine.
Additionally, I need to add other C/C++ libraries which must be included in the header of the interoop library (dependencies).
I added those libraries into the same folder where the final files that I copied from the stubs folder when building the interop library are.
When I try to generate the image, the build passes correctly but gives an error when trying to link and not found the references in the code like methods, classes, etc.. from the external library.

I was looking for possible solutions and found that I may have to add the "minimal" components to the CMakeList.txt so that they are included in the system build https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html#minimal-component-cmakelists
But..
What is the correct way to fix this or the best practices to add external libraries?

novel fractal
#

The actual error is should be further up.

stoic narwhal
novel fractal
#

the #define DT_DIR is not an issue, But you Arduino header is an issue.

stoic narwhal
#

Ok, I'm going to try to resolve that warning. This thing about adding the Arduino header as an external library is not being easy for me.. I don't even know if it's going to work as I expect..
Thank you!

novel fractal
#

Just plonking in the Adruino header is not going to automagically work. 😋

unique onyx
#

The Interop it's just the mechanism to tap into the build system and interact with the rest of the CLR and API.
What you're seeing there it's C build issues. You need to add include files for the headers and make the declarations. As usual.