Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU) Jetson Nano
• DeepStream Version 5.0
• JetPack Version (valid for Jetson only) 4.4-b144
• TensorRT Version 7.1.3
• Issue Type( questions, new requirements, bugs) question
Dear all,
I would like to exploit OpenCV API within a probe in the deepstream-test3-app.
I am following this example:
I have included the following statements in the deepstream-test3-app.c
#include "/usr/include/opencv4/opencv2/core.hpp"
#include "/usr/include/opencv4/opencv2/highgui/highgui.hpp"
This is the makefile that I use:
APP:= deepstream-test3-app
TARGET_DEVICE = $(shell gcc -dumpmachine | cut -f1 -d -)
NVDS_VERSION:=5.0
LIB_INSTALL_DIR?=/opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/lib/
ifeq ($(TARGET_DEVICE),aarch64)
CFLAGS:= -DPLATFORM_TEGRA
endif
SRCS:= $(wildcard *.c)
INCS:= $(wildcard *.h)
PKGS:= gstreamer-1.0 opencv4
OBJS:= $(SRCS:.c=.o)
CFLAGS+= -I../../../includes
CFLAGS+= `pkg-config --cflags $(PKGS)`
LIBS:= `pkg-config --libs $(PKGS)`
LIBS+= -L$(LIB_INSTALL_DIR) -lnvdsgst_meta -lnvds_meta -lnvdsgst_helper -lm \
-Wl,-rpath,$(LIB_INSTALL_DIR)
all: $(APP)
%.o: %.c $(INCS) Makefile
$(CC) -c -o $@ $(CFLAGS) $<
$(APP): $(OBJS) Makefile
$(CC) -o $(APP) $(OBJS) $(LIBS)
clean:
rm -rf $(OBJS) $(APP)
However when I compile the app I receive the following error:
cc -c -o deepstream_test3_app.o -DPLATFORM_TEGRA -I../../../includes `pkg-config --cflags gstreamer-1.0 opencv4` deepstream_test3_app.c
In file included from deepstream_test3_app.c:67:0:
/usr/include/opencv4/opencv2/core.hpp:49:4: error: #error core.hpp header must be compiled as C++
# error core.hpp header must be compiled as C++
^~~~~
In file included from /usr/include/opencv4/opencv2/core.hpp:52:0,
from deepstream_test3_app.c:67:
/usr/include/opencv4/opencv2/core/cvdef.h:690:4: error: #error "OpenCV 4.x+ requires enabled C++11 support"
# error "OpenCV 4.x+ requires enabled C++11 support"
^~~~~
/usr/include/opencv4/opencv2/core/cvdef.h:695:10: fatal error: array: No such file or directory
#include <array>
^~~~~~~
compilation terminated.
Makefile:55: recipe for target 'deepstream_test3_app.o' failed
make: *** [deepstream_test3_app.o] Error 1
Would you be so kind to help me fixing this error?
Thank you very much in advance!!