Compile QT app in Ubuntu

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Compile QT app in Ubuntu

Mikl
This post was updated on .
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?

The same project compiles on windows with no problem.

------------------------------------
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/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Compile QT app in Ubuntu

Mikl
Hello,

I found the reason:
i am referencing on glibconfig.h, generated for windows.

Where i can find linux (ubuntu) specific one?

Mikl



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Compile QT app in Ubuntu

Mikl
In reply to this post by Mikl
Hello,

Done.

i need to install
sudo apt-get install libglib2.0-dev

and it will be on
/usr/lib/x86_64-linux-gnu/glib-2.0/include

Hope can help.

Mikl



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Compile QT app in Ubuntu

Tomaz Canabrava
In reply to this post by Mikl


On Thu, Sep 7, 2017 at 11:27 AM, Mikl <[hidden email]> wrote:
Hello,

I found the reason:
i am referencing on glibconfig.h, generated for windows.

Where i can find linux (ubuntu) specific one?

Do you realize that this is a glib question, not gstreamer, right?
Please, ask in the correct mailing list. :)


Mikl



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel