Qt Creator and OpenNI framework problems
-
Hi,
I am new to Qt and Qt Creator. This is something that I need to use for my Master Thesis project. In this project I have to make a platform independent application that uses the Kinect Camera and OpenNI framework. I made a new project in Qt Creator. In one of the headers of my project I include XnCppWrapper.h, which is required if you want to use OpenNI. I have not made any code that uses anything from the header, but I tried to compile to see if Qt Creator could find the necessary includes and libs. Well they were found, but this is also where all hell breaks lose.
I got a number of errors. These are the most prominent:
- ........Program FilesOpenNIInclude/XnPlatform.h:57:26: error: #error Xiron Platform Abstraction Layer - Win32 - Microsoft Visual Studio versions below 2003 (7.0) are not supported!
from this code:
@
//---------------------------------------------------------------------------
// Platform Identifier
//---------------------------------------------------------------------------#if defined(_WIN32) // Microsoft Visual Studio
#ifndef RC_INVOKED
#if _MSC_VER < 1300 // Before MSVC7 (2003)
#error Xiron Platform Abstraction Layer - Win32 - Microsoft Visual Studio versions below 2003 (7.0) are not supported!
#endif#if _MSC_VER > 1600 // After MSVC8 (2010)
#error Xiron Platform Abstraction Layer - Win32 - Microsoft Visual Studio versions above 2010 (10.0) are not supported!
#endif
#endif#include "Win32/XnPlatformWin32.h"
#elif (linux && (i386 || x86_64))
#include "Linux-x86/XnPlatformLinux-x86.h"
#elif (linux && arm)
#include "Linux-Arm/XnPlatformLinux-Arm.h"
#elif (APPLE)
#include "MacOSX/XnPlatformMacOSX.h"
#else
#error OpenNI Platform Abstraction Layer - Unsupported Platform!
#endif
@and
- ........Program FilesOpenNIInclude/Win32/XnPlatformWin32.h:59:20: error: crtdbg.h: No such file or directory
This is an include and by searching google I found out that it is an debugger header used by Visual Studio to find memory leaks. However how to make it available in Qt Creator and have Qt Creator accept the OpenNI framework is something I cannot find. What I did find was that other people used the OpenNI framework succesfully in Qt Creator.
So what am I doing wrong? Anyone have any experience using OpenNI in Qt Creator.
As additional information I post the following:
My Qt Creator version:
Qt Creator 2.0.0
Based on Qt 4.7.0 (32 bit)Built on Jun 21 2010 at 01:56:06
From revision 1c0f52a091
My .pro file
@
#-------------------------------------------------Project created by QtCreator 2011-02-10T16:12:48
#-------------------------------------------------
QT += core gui
TARGET = KinectProject
TEMPLATE = appINCLUDEPATH += include
Windows common build here
CONFIG(debug, debug|release) {
LIBS += -lopenNI
-lNiSampleModule
#QMAKE_LIBDIR += $$quote(OPEN_NI_LIB)
#QMAKE_LIBDIR += $$quote(OPEN_NI_BIN)
#LIBS += -L$$quote(OPEN_NI_BIN)
QMAKE_LIBDIR += $$quote(c:/Program Files/OpenNI/Lib)
QMAKE_LIBDIR += $$quote(c:/Program Files/OpenNI/Bin)
LIBS += -L$$quote(c:/Program Files/OpenNI/Bin)
}
CONFIG(release, debug|release) {
LIBS += -lopenNI
-lNiSampleModule
#QMAKE_LIBDIR += $$quote(OPEN_NI_LIB)
#QMAKE_LIBDIR += $$quote(OPEN_NI_BIN)
#LIBS += -L$$quote(OPEN_NI_BIN)
QMAKE_LIBDIR += $$quote(c:/Program Files/OpenNI/Lib)
QMAKE_LIBDIR += $$quote(c:/Program Files/OpenNI/Bin)
LIBS += -L$$quote(c:/Program Files/OpenNI/Bin)
}#INCLUDEPATH += $$quote(OPEN_NI_INCLUDE)
$$quote(OPEN_NI_INCLUDE/Win32)
INCLUDEPATH += $$quote(c:/Program Files/OpenNI/Include)
$$quote(C:Program FilesOpenNIIncludeWin32)SOURCES += src/main.cpp
src/mainwindow.cppHEADERS += include/mainwindow.h
include/DataProcessor.hFORMS += resources/Forms/mainwindow.ui
RESOURCES += resources/Icons/icons.qrc
@I'd love to add the compile output, but apparently exceeds the number of characters allowed per post.
-
This is the compile output part 1:
@
Running build steps for project DataProcessor...
Configuration unchanged, skipping qmake step.
Starting: "C:/Qt/2010.04/mingw/bin/mingw32-make.exe" -w
mingw32-make: Entering directoryC:/local/NiekHoeijmakers/Project_Repository/KinectProject-build-desktop' c:qt2010.04qtbinqmake.exe -spec ........Qt2010.04qtmkspecswin32-g++ -win32 -o Makefile ..DataProcessorDataProcessor.pro mingw32-make: Leaving directory
C:/local/NiekHoeijmakers/Project_Repository/KinectProject-build-desktop'
mingw32-make: Entering directoryC:/local/NiekHoeijmakers/Project_Repository/KinectProject-build-desktop' C:/Qt/2010.04/mingw/bin/mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory
C:/local/NiekHoeijmakers/Project_Repository/KinectProject-build-desktop'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"........Qt2010.04qtincludeQtCore" -I"........Qt2010.04qtincludeQtGui" -I"........Qt2010.04qtinclude" -I"..DataProcessorinclude" -I"........Program FilesOpenNIInclude" -I"........Program FilesOpenNIIncludeWin32" -I"........Qt2010.04qtincludeActiveQt" -I"debug" -I"." -I"..DataProcessor" -I"." -I"........Qt2010.04qtmkspecswin32-g++" -o debugmain.o ..DataProcessorsrcmain.cpp
In file included from ........Program FilesOpenNIInclude/XnStatus.h:29,
from ........Program FilesOpenNIInclude/XnTypes.h:31,
from ........Program FilesOpenNIInclude/XnOpenNI.h:31,
from ........Program FilesOpenNIInclude/XnCppWrapper.h:32,
from ..DataProcessorinclude/DataProcessor.h:18,
from ..DataProcessorsrcmain.cpp:2:
........Program FilesOpenNIInclude/XnPlatform.h:57:26: error: #error Xiron Platform Abstraction Layer - Win32 - Microsoft Visual Studio versions below 2003 (7.0) are not supported!
In file included from ........Program FilesOpenNIInclude/XnPlatform.h:65,
from ........Program FilesOpenNIInclude/XnStatus.h:29,
from ........Program FilesOpenNIInclude/XnTypes.h:31,
from ........Program FilesOpenNIInclude/XnOpenNI.h:31,
from ........Program FilesOpenNIInclude/XnCppWrapper.h:32,
from ..DataProcessorinclude/DataProcessor.h:18,
from ..DataProcessorsrcmain.cpp:2:
........Program FilesOpenNIInclude/Win32/XnPlatformWin32.h:59:20: error: crtdbg.h: No such file or directory
In file included from ..DataProcessorinclude/DataProcessor.h:18,
from ..DataProcessorsrcmain.cpp:2:
........Program FilesOpenNIInclude/XnCppWrapper.h:4770:76: error: macro "XN_VALIDATE_NEW" passed 4 arguments, but takes just 2
In file included from ..DataProcessorinclude/DataProcessor.h:18,...
........Program FilesOpenNIInclude/XnCppWrapper.h:4770: error: 'XN_VALIDATE_NEW' was not declared in this scope
mingw32-make[1]: Leaving directoryC:/local/NiekHoeijmakers/Project_Repository/KinectProject-build-desktop' mingw32-make: Leaving directory
C:/local/NiekHoeijmakers/Project_Repository/KinectProject-build-desktop'
mingw32-make[1]: *** [debug/main.o] Error 1
mingw32-make: *** [debug] Error 2
The process "C:/Qt/2010.04/mingw/bin/mingw32-make.exe" exited with code %2.
Error while building project DataProcessor (target: Desktop)
When executing build step 'Make'
@ -
How is this question related to Qt Creator or Qt?
-
Well, I do not know exactly. That is why ask in both places. Qt and OpenNI
But for the first problem these if's evaluate to true
#if defined(_WIN32)
#ifndef RC_INVOKED
#if _MSC_VER < 1300
end thus casting an error. And with the second it seems as if something standard should be imported. It just is that there are people who did get it all to work, but I don't know how it works. But I have had other kind of problems with Qt. Problems that other people told me should not happen.For example:
QObject::connect: Cannot queue arguments of type 'QVariant'
(Make sure 'QVariant' is registered using qRegisterMetaType().)I solved this by explicity registering QVariant.
-
I just installed Qt Creator with the install file. I don't know which compiler is configured with that. But looking at the Build Settings in my project I think it is mingw
[quote]
mingw32-make.exe -w in C:\local\NiekHoeijmakers\Project_Repository\KinectProject-build-desktop
[/quote]