Compile QT app in Ubuntu

Mikl michael.yarochkin at timetronics.be
Thu Sep 7 08:56:04 UTC 2017


Hello,

I have this errors when compiling c++ QT project in Ubuntu 16.

/In file included from
/media/sf_TT/Module/Utility/Video/GStreamer/Library/include/glib-2.0/glib/galloca.h:32:0,
                 from
/media/sf_TT/Module/Utility/Video/GStreamer/Library/include/glib-2.0/glib.h:30,
                 from
/media/sf_TT/Module/Utility/Video/GStreamer/Library/include/gstreamer-1.0/gst/gst.h:27,
                 from
/media/sf_TT/Module/Utility/Video/GStreamer/gstreamerrecorder.cpp:9:
/media/sf_TT/Module/Utility/Video/GStreamer/Library/include/glib-2.0/glib/gtypes.h:530:53:
error: ISO C++ forbids declaration of ‘__declspec’ with no type
[-fpermissive]
 #        define GLIB_VAR extern __declspec(dllimport)
                                                     ^
/media/sf_TT/Module/Utility/Video/GStreamer/Library/include/glib-2.0/glib/gmem.h:361:1:
note: in expansion of macro ‘GLIB_VAR’
 GLIB_VAR gboolean g_mem_gc_friendly;
 ^
/media/sf_TT/Module/Utility/Video/GStreamer/Library/include/glib-2.0/glib/gtypes.h:530:53:
warning: ‘__declspec’ initialized and declared ‘extern’
 #        define GLIB_VAR extern __declspec(dllimport)
                                                     ^
/media/sf_TT/Module/Utility/Video/GStreamer/Library/include/glib-2.0/glib/gmem.h:361:1:
note: in expansion of macro ‘GLIB_VAR’
 GLIB_VAR gboolean g_mem_gc_friendly;
 ^
/media/sf_TT/Module/Utility/Video/GStreamer/Library/include/glib-2.0/glib/gtypes.h:530:44:
error: ‘dllimport’ was not declared in this scope
 #        define GLIB_VAR extern __declspec(dllimport)
                                            ^
/media/sf_TT/Module/Utility/Video/GStreamer/Library/include/glib-2.0/glib/gmem.h:361:1:
note: in expansion of macro ‘GLIB_VAR’
 GLIB_VAR gboolean g_mem_gc_friendly;
 ^/

and 217 more of the same type

What is wrong?
How to fix it?

------------------------------------
that's how i include gstreamer headers:
extern "C" {
//gstreamer library
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
#include "gst/app/gstappsrc.h"
}

------------------------------------
.pro file:

#common settings for module
TEMPLATE = lib

CONFIG += c++11
CONFIG += plugin
CONFIG += debug_and_release
CONFIG(release, debug|release): DESTDIR = ../../../../Release
CONFIG(debug, debug|release): DESTDIR = ../../../../Debug

INCLUDEPATH += ./GeneratedFiles \
    . \
    ./GeneratedFiles/Debug
DEPENDPATH += .
MOC_DIR += ./GeneratedFiles/debug
OBJECTS_DIR += debug
UI_DIR += ./GeneratedFiles
RCC_DIR += ./GeneratedFiles

QMAKE_CXXFLAGS += -Wno-unknown-pragmas

#specific settings
QMAKE_CXXFLAGS += -Wno-ignored-qualifiers

QT += core
DEFINES += QT_DLL GSTREAMER_LIB
TARGET = GStreamer
include(GStreamer.pri)
win32:RC_FILE = GStreamer.rc

#dependency settings
#core
CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../../../Release
-lTTCore
CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../../../Debug -lTTCore

#utilities

#external library
LIBS += -L$$PWD/Library/lib -lgstreamer-1.0
LIBS += -L$$PWD/Library/lib -lgobject-2.0
LIBS += -L$$PWD/Library/lib -lglib-2.0
LIBS += -L$$PWD/Library/lib -lgstapp-1.0

INCLUDEPATH +=  $$PWD/Library/include/gstreamer-1.0 \
                $$PWD/Library/lib/gstreamer-1.0/include \
                $$PWD/Library/include/glib-2.0 \
                $$PWD/Library/lib/glib-2.0/include

------------------------------------
compiler command line, generated by qt:

g++ -c -pipe -Wno-unknown-pragmas -Wno-ignored-qualifiers -g -std=gnu++11
-Wall -W -D_REENTRANT -fPIC -DQT_DLL -DGSTREAMER_LIB -DQT_QML_DEBUG
-DQT_PLUGIN -DQT_GUI_LIB -DQT_CORE_LIB
-I/media/sf_TT/Module/Utility/Video/GStreamer -I.
-I/media/sf_TT/Module/Utility/Video/GStreamer/GeneratedFiles
-I/media/sf_TT/Module/Utility/Video/GStreamer
-I/media/sf_TT/Module/Utility/Video/GStreamer/GeneratedFiles/Debug
-I/media/sf_TT/Module/Utility/Video/GStreamer/Library/include/gstreamer-1.0
-I/media/sf_TT/Module/Utility/Video/GStreamer/Library/lib/gstreamer-1.0/include
-I/media/sf_TT/Module/Utility/Video/GStreamer/Library/include/glib-2.0
-I/media/sf_TT/Module/Utility/Video/GStreamer/Library/lib/glib-2.0/include
-I/home/tt/Qt/5.9.1/gcc_64/include -I/home/tt/Qt/5.9.1/gcc_64/include/QtGui
-I/home/tt/Qt/5.9.1/gcc_64/include/QtCore -IGeneratedFiles/debug -isystem
/usr/include/libdrm -I/home/tt/Qt/5.9.1/gcc_64/mkspecs/linux-g++ -o
debug/gstreamerrecorder.o
/media/sf_TT/Module/Utility/Video/GStreamer/gstreamerrecorder.cpp


Do you need something else?

Mikl



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list