PDA

View Full Version : QtCore/QtGlobal: No such file or directory



JackCity63
3rd June 2015, 18:48
I am working with QtGStreamer on one of the examples, and I cannot get it to work. I keep getting the error 'QtCore/QtGlobal: No such file or directory' from global.h, when I try #include <QtCore/QtGlobal in main.cpp I don't get an error from that.
Here is my code:

main.cpp


#include "mediaapp.h"
#include <QApplication>
#include <QGst/Init>


int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QGst::init(&argc, &argv);

MediaApp media;
media.show();

if (argc == 2) {
media.openFile(argv[1]);
}

return app.exec();
}



player.pro


TEMPLATE = app
TARGET = player

CONFIG += silent

CONFIG += pkgconfig

contains(QT_VERSION, ^4\\..*) {
PKGCONFIG += QtGStreamer-1.0 QtGStreamerUi-1.0
}
contains(QT_VERSION, ^5\\..*) {
PKGCONFIG += Qt5GStreamer-1.0 Qt5GStreamerUi-1.0\
}

QT += core quick widgets
CONFIG += qt console bootstrap

DEFINES += QT_NO_KEYWORDS

HEADERS += mediaapp.h player.h
SOURCES += main.cpp mediaapp.cpp player.cpp

INCLUDEPATH += C:\qt-gstreamer-1.2.0\src \
C:\Qt\Qt5.4.1\5.4\mingw491_32\include \
C:\Qt\Qt5.4.1\5.4\android_armv5\include \
C:\Qt\Qt5.4.1\5.4\android_armv7\include \
C:\Qt\Qt5.4.1\5.4\android_x86\include \
C:\Qt\Qt5.4.1\5.4\Src\qtbase\include


In C:\Qt\...\include there is a directory QtCore with QtGlobal. While typing it in to global.h I get suggestions to put it in, but it throws an error when I try and build it.

ChrisW67
3rd June 2015, 21:54
Start by running "make clean", removing Lines 24-28 from the pro file, removing the QtGlobal include you added, rerunning qmake from the version of Qt that matches the version used by QtGStreamer, and then make.

If you still get compile errors then post the errors and the compiler command that generated them.

JackCity63
3rd June 2015, 22:09
I am still getting an error, here is the compile output



17:05:24: Running steps for project player...
17:05:24: Configuration unchanged, skipping qmake step.
17:05:24: Starting: "C:\Qt\Qt5.4.1\Tools\mingw491_32\bin\mingw32-make.exe"
C:/Qt/Qt5.4.1/Tools/mingw491_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/qt-gstreamer-1.2.0/examples/build-player-Desktop_Qt_5_4_1_MinGW_32bit-Debug'
compiling ../../src/QGst/Init.cpp
In file included from ../../src/QGst/../QGlib/type.h:22:0,
from ../../src/QGst/global.h:25,
from ../../src/QGst/init.h:20,
from ../../src/QGst/Init.cpp:17:
../../src/QGst/../QGlib/global.h:26:27: fatal error: QtCore/QtGlobal: No such file or directory
#include <QtCore/QtGlobal>
^
compilation terminated.
<builtin>: recipe for target '../../src/QGst/Init' failed
mingw32-make[1]: *** [../../src/QGst/Init] Error 1
mingw32-make[1]: Leaving directory 'C:/qt-gstreamer-1.2.0/examples/build-player-Desktop_Qt_5_4_1_MinGW_32bit-Debug'
makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2
17:05:25: The process "C:\Qt\Qt5.4.1\Tools\mingw491_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project player (kit: Desktop Qt 5.4.1 MinGW 32bit)
When executing step "Make"
17:05:25: Elapsed time: 00:01.

ChrisW67
6th June 2015, 12:11
How have you provided a working pkg-config in your Windows build environment?