Please provide complete information as applicable to your setup.
• Hardware Platform Jetson
• DeepStream Version 5.0
• JetPack Version 4.4
• Sample application and the configuration file content
I am following the create intelligent Places webinar to try and add nvanlaytics meta data to deepstream app 5
I have followed the 5 steps but am getting the below error when running make:
deepstream_test5_app_main.c: undefined reference to my_custom_parse_nvdsanalytics_meta_data
collect2: error: ld returned 1 exit status
Makefile:64: recipe for target 'deepstream-test5-app' failed
Appears there is an issue with my cpp and c file linking. In my deepstream_test5_app_main.c I have added:
void my_custom_parse_nvdsanalytics_meta_data (NvDsMetaList *l_user, MyUserMeta *data);
I have then created a deepstream_nvdsanalytics_meta.cpp as below:
extern "C" void
my_custom_parse_nvdsanalytics_meta_data (NvDsMetaList *l_user, MyUserMeta *data)
{
std::stringstream out_string;
NvDsUserMeta *user_meta = (NvDsUserMeta *) l_user->data;
/* convert to metadata */
NvDsAnalyticsFrameMeta *meta =
(NvDsAnalyticsFrameMeta *) user_meta->user_meta_data;
/* Get the labels from nvdsanalytics config file */
data->lcc_cnt_entry = meta->objLCCumCnt["Entry"];
data->lcc_cnt_exit = meta->objLCCumCnt["Exit"];
data->lccum_cnt = meta->objLCCumCnt["Entry"] - meta->objLCCumCnt["Exit"];
}
// Add this structure at includes/myheader.h //
/*typedef struct
{
guint32 lcc_cnt_exit;
guint32 lcc_cnt_entry;
} MyUserMeta;
*/
The make file is:
APP:= deepstream-test5-app
TARGET_DEVICE = $(shell gcc -dumpmachine | cut -f1 -d -)
NVDS_VERSION:=5.0
LIB_INSTALL_DIR?=/opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/lib/
APP_INSTALL_DIR?=/opt/nvidia/deepstream/deepstream-$(NVDS_VERSION)/bin/
ifeq ($(TARGET_DEVICE),aarch64)
CFLAGS:= -DPLATFORM_TEGRA
endif
SRCS:= deepstream_test5_app_main.c deepstream_utc.c
SRCS+= ../deepstream-app/deepstream_app.c ../deepstream-app/deepstream_app_config_parser.c
SRCS+= $(wildcard ../../apps-common/src/*.c)
INCS:= $(wildcard *.h)
PKGS:= gstreamer-1.0 gstreamer-video-1.0 x11 json-glib-1.0
OBJS:= $(SRCS:.c=.o)
CFLAGS+= -I../../apps-common/includes -I../../../includes -I../deepstream-app/ -DDS_VERSION_MINOR=0 -DDS_VERSION_MAJOR=5
LIBS+= -L$(LIB_INSTALL_DIR) -lnvdsgst_meta -lnvds_meta -lnvdsgst_helper -lnvdsgst_smartrecord -lnvds_utils -lnvds_msgbroker -lm \
-lgstrtspserver-1.0 -ldl -Wl,-rpath,$(LIB_INSTALL_DIR)
CFLAGS+= `pkg-config --cflags $(PKGS)`
LIBS+= `pkg-config --libs $(PKGS)`
all: $(APP)
deepstream_nvdsanalytics_meta.o: deepstream_nvdsanalytics_meta.cpp $(INCS) Makefile
$(CXX) -c -o $@ -Wall -Werror $(CFLAGS) $<
%.o: %.c $(INCS) Makefile
$(CC) -c -o $@ $(CFLAGS) $<
$(APP): $(OBJS) Makefile
$(CC) -o $(APP) $(OBJS) $(LIBS)
install: $(APP)
cp -rv $(APP) $(APP_INSTALL_DIR)
clean:
rm -rf $(OBJS) $(APP)
What have I missed in linking the function? Thanks