Issue while building the project:

Hello,

I was trying to run TFLM custom code on Thingy:53 device and while building I have faced these warnings.

1. Could you please help me to understand Why I am facing these warning?

2. How can I Remove solve these problems?

Regards,

Divya

Parents Reply
  • Thanks for the quick reply.

    Actually I want to add a.cc file in the src folder and then want to call inside the main.c file.

    But it is showing an error that : No Sorce given to the target: app cmake in line 418. So, what should I do to include a .cc file inside main.c file.

    Does calling a C++ file inside a C is really support by Thingy?

    If not then is there any possibilty to build and Flash Thingy with a C++ file like main.cc in place of main.c?

    Regards,

    Divya

Children
  • Hi Divya,

    Are you trying to include the C++ file directly or through a header file? You cannot include source files, so you must include the header file in main.c.

    Also, you cannot use C++ code in C files. If you put a C function (from your C++ file) in an extern "C" block in your header file, then you can use it in your C file, but you cannot use C++ classes and many other C++ features in a C file. If you search online you will be able to find a lot of information about this, and about how to use extern "C". If you want to use C++ features then you should have your main file as a C++ file instead of C. This is for example done for Matter samples in nRF Connect SDK, so you can look there for examples (nrf/samples/matter).

    Best regards,

    Marte

  • Hello Marte,

    I have followed the same solution as you have mentioned above, I will explore more about the matter example. Thank you for sharing.

    Now after adding C++ header file along with other header files I am facing some issues. it seems like I am not able to add libraries from other folder.

    So, I have cloned a repository inside the src directory in a separate folder named tensorflow inside "src" and it is showing me the error like:

    As you mentioned earlier I can add all the extra file in the CMakelist.txt. So, I have added them like:

    can you please help me why I am not able to access the header file inside the tensorflow folder? I have checked and verified that these files are at the mentioned location.

    Regards,

    Divya

Related