This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Cpp Problem

Hello Sir or ma'am

I am trying to load CPP SDK on my nrf52840 DK, But whenever I compile my code it through the error like this," vector: No such file or directory".
Now, What can I do.I am using segger embedded studio for code editing build and programing to board , I have standard cpp library which i made using edge impulse studio .

I linked all the folder and .h , .cc , .cpp , .c , .hpp files in CMakeLists.txt.

  • Hi,

    I am going to need some more information from you:

    1. Which SDK are you using? nRF5 SDK? nRF Connect SDK?

    2. Which version of the SDK are you using?

    3. What application are you trying to build? One of the samples? Which one? Or your own application?

    3. How did you "link all the folder and .h, .cc, .cpp, .c, .hpp files in CMakeLists.txt

    4. What do you mean by this?

     

    I have standard cpp library which i made using edge impulse studio

     What do you mean by this? Have you compiled the C++ standard library?

    5. Which file is giving the error?

    Best regards,

    Didrik

  • target_sources(app PRIVATE
    		
    ./src/test/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_q15.c
    ./src/test/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_with_batch_q7.c
    ./src/test/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_q7.c
    ./src/test/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_s8.c
    ./src/test/edge-impulse-sdk/CMSIS/NN/Source/SoftmaxFunctions/arm_softmax_u8.c
    ./src/test/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_pool_q7_HWC.c
    ./src/test/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_avgpool_s8.c
    ./src/test/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_max_pool_s8.c
    ./src/test/edge-impulse-sdk/CMSIS/NN/Source/PoolingFunctions/arm_max_pool_s8_opt.c

    ok sir ,

    1. Which SDK are you using? nRF5 SDK? nRF Connect SDK?

    -> nRF Connect SDK

    2. Which version of the SDK are you using?

    -> nRF Connect SDK v1.3.2

    3. What application are you trying to build? One of the samples? Which one? Or your own application?

    -> I am try to build AI demo using edge impulse standard cpp files, Motion detection (left-to-right,stay,up-to-down) using     

         accelerometer sensor.

          Board :- nRF52840 DK , Sensor :- lis2dw12

    4. How did you "link all the folder and .h, .cc, .cpp, .c, .hpp files in CMakeLists.txt

    -> I attached some lines in code section for just example

    5.  What do you mean by this? Have you compiled the C++ standard library?

    -> Edge impulse studio is online dashboard which create AI based library . That library is in Cpp

    6. Which file is giving the error?

    -> #inlcude<vector>.....  error is "vector: No such file or directory"

  • 5. What do you mean by this? Have you compiled the C++ standard library?

    -> I refer your sample code which is given in zephyr sample section -- cpp_synchronization

  • Thank you, knowing the context helps a lot.

    The nRF Connect SDK should support C++, but this is not something that has been tested a lot, so some problems could potentially occur.

    There is some documentation about C++ support in Zephyr, and by extension NCS here: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/kernel/other/cxx_support.html

    To enable C++ support in NCS, you must add CONFIG_CPLUSPLUS=y to your prj.conf file (if you are building with SES, you must re-open the project for the changes in prj.conf to take effect). In addition, you need CONFIG_NEWLIB_LIBC=y and CONFIG_LIB_CPLUSPLUS=y to enable the standard C++ library. In addition to those, you might also need CONFIG_NEWLIB_LIBC_NANO=n to enable full Newlib libc support.

    Could you try to add those configs, in addition to making sure that the file that includes <vector> is a .cpp file?

  • Thanks for reply ,

    But its not working , I was trying to add CONFIG_NEWLIB_LIBC=y, CONFIG_NEWLIB_LIBC=y and CONFIG_NEWLIB_LIBC_NANO=n  in prj.conf but after this I got so many new errors with vector error.

    what can I do now ?

Related