Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Build Qt5 error from deepstream-app
Forum Updated to NodeBB v4.3 + New Features

Build Qt5 error from deepstream-app

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
2 Posts 2 Posters 316 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PhongNT
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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).

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved