Integration of standalone c++ lib with existing 'C' project

Hello Edge,
I would like to integrate the standalone c++ lib specific generated for my application, But I see most of file are in cpp/hpp externsion hence find difficult to intergtaed with exisitng embedded c project for MPC55xx controller.
Is there any way to integrated existing C project?

-Vikas

Hi @vikas, you can create a library from the C++ Lib and link to it from a C application. See https://github.com/edgeimpulse/example-standalone-inferencing-c for an example that runs on Windows/MacOS/Linux.

But if your target has a C++ compiler will be a lot easier just to use that (and keep C for the rest of the application).

You mean

  1. created C++ lib from MCU specific compiler
  2. then use this lib to integrate with existing embedded C project?
  3. make call the classifier function in appropriate module of legacy project/
  4. then compile all together to get single image

-Vikas B

Hi @vikas, that’s what we do in the example that I linked in.

  1. Compile into shared library.
  2. Link against shared library.