Compilation error with nvds_analytics_meta.h

**• Hardware Platform: Jetson Xavier NX (Recomputer J2021)
**• DeepStream Version: 6.1
**• JetPack Version: 5.0.2
**• TensorRT Version:
**• NVIDIA GPU Driver Version (valid for GPU only):

Hello everyone, I am using the deepstream app which is located in “source/apps/samples_apss/deepstream-app/deepstream_app.c”, I am integrating “nvds_analytics_meta.h” with “include”. But when compiling I get an error which is: “…/…/…/includes/nvds_analytics_meta.h:30:10: fatal error: vector: No such file or directory
#include < vector >”.

How can I correct this error?

Is vector exist at /usr/include/c++/9/ , can you try ls -l /usr/include/c++/9/vector ?

If not try

sudo apt install libstdc++-9-dev

This is stl header, If g++ is installed, there will be no problem usually

It does exist, however I still get the error “< vector >” cannot be found. Run deepstream-nvdsanalytics-test and there was no error incorporating the vector library. What is the mistake?

I was carrying out tests and it turns out that the compiler does not find the libraries, however, if in the headers the burnt address where said library is located is placed, it can be compiled. Now another problem arises and that is that I have to do this for each library that is not found. some way so that the compiler i haved use “CUDA_VER=11.4 make” can detect the same libraries that would be used for “nvds_analytics_meta.h”?

I already tried to install several versions and specified which version to use, and even so I have the same error that the libraries cannot be found.

I know the cause of your problem.
deepstream_app.c is a C language file.but nvds_analytics_meta.h is CPP header.
try modify deepstream_app.c to deepstream_app.cpp

I transform my source code from c to cpp code? With this I can keep both codes? I mean, should I change the syntax of my code so that it is compatible with that of cpp?, To compile the code will you stop using make?

If your code don’t use cpp lib such as stl. keep your code as before.

But source file which use such as nvds_analytics_meta.h,please modify the extension.

This is not DeepStream problem.


1 Like

Thank you very much, you are right changing my file extension from “c” to “cpp” allows me to compile.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.