Build Qt5 error from deepstream-app
Unsolved
Installation and Deployment
-
Hello all,
I am try to build my app in C with Qt5, but it not working and show many error:
In file included from /usr/include/aarch64-linux-gnu/qt5/QtCore/qstring.h:48:0, from /usr/include/aarch64-linux-gnu/qt5/QtCore/qcoreapplication.h:44, from /usr/include/aarch64-linux-gnu/qt5/QtWidgets/qapplication.h:44, from /usr/include/aarch64-linux-gnu/qt5/QtWidgets/QApplication:1, from deepstream_test3_app.c:27: /usr/include/aarch64-linux-gnu/qt5/QtCore/qchar.h:48:1: error: unknown type name ‘class’ class QString; ^~~~~ /usr/include/aarch64-linux-gnu/qt5/QtCore/qchar.h:52:1: error: expected specifier-qualifier-list before ‘public’ public: ^~~~~~ /usr/include/aarch64-linux-gnu/qt5/QtCore/qchar.h:62:1: warning: data definition has no type or storage class class Q_CORE_EXPORT QChar {.....
My include code:
#include <gst/gst.h> #include <glib.h> #include <gst/video/videooverlay.h> #include <QApplication> #include <QTimer> #include <QWidget> #include <stdio.h> #include <math.h> ....
Makefile:
CUDA_VER?=10.2 ifeq ($(CUDA_VER),) $(error "CUDA_VER is not set") endif APP:= deepstream-test3-app TARGET_DEVICE = $(shell gcc -dumpmachine | cut -f1 -d -) NVDS_VERSION:=6.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:= $(wildcard *.c) SRCS+= $(wildcard ../../apps-common/src/deepstream_perf.c) INCS:= $(wildcard *.h) PKGS:= gstreamer-1.0 OBJS:= $(SRCS:.c=.o) CFLAGS+= -I../../../includes \ -I../../apps-common/includes \ -I /usr/local/cuda-$(CUDA_VER)/include \ -I /usr/include/aarch64-linux-gnu/qt5 \ -I /usr/include/aarch64-linux-gnu/qt5/QtWidgets \ -I /usr/include/aarch64-linux-gnu/qt5/QtCore \ -I /usr/include/aarch64-linux-gnu/qt5/QtGui \ CFLAGS+= $(shell pkg-config --cflags $(PKGS)) LIBS:= $(shell pkg-config --libs $(PKGS)) LIBS+= -L/usr/local/cuda-$(CUDA_VER)/lib64/ -lcudart -lnvdsgst_helper -lm \ -L$(LIB_INSTALL_DIR) -lnvdsgst_meta -lnvds_meta \ -lcuda -Wl,-rpath,$(LIB_INSTALL_DIR) \ -lQt5Widgets -lQt5Gui -lQt5Core all: $(APP) %.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)
Please help me.
Thank so much
-
Hi and welcome to devnet,
Qt is a C++ framework so unless you have written C wrappers around it you will need to build your code a C++.
See mixing C and C++ in the iso cpp wiki%3B%20%2F%2F%20one%20way).