Hi guys I am creating a simple game using cocos2d-x and blackberry. I need some place to store my game settings, something similar to shared preferences in ios and android. I found some code using qsettings, but the problem is I am not able to add the QtCore library.
I add the library using RightClick->configure->add Library and Standard BlackBerry Platform Library. The library gets added successfully.
#include "dataProcessor.h"
#include <QtCore>
void dataProcessor::setup(){
QDir dir;
dir.mkpath("data/files/text");
dir.cd("data/files/text");
}
but when I compile the above code, I get the error C:/Users/I076636/Documents/target_10_0_9_1673/qnx6/usr/include/qt4/QtCore/qatomic.h:45:28: fatal error: QtCore/qglobal.h: No such file or directory
But I noticed 2 things,
1.qglobal.h file is there inside the QtCore directory I have included.
2.inside qatomic.h if I change
#ifndef QATOMIC_H
#define QATOMIC_H
#include <QtCore/qglobal.h>
#include <QtCore/qbasicatomic.h>
into
#ifndef QATOMIC_H
#define QATOMIC_H
#include <qglobal.h>
#include <QtCore/qbasicatomic.h>
the error for qglobal goes and now the same error comes for qbasicatomic.h.
I think it is something simple like incorrect mapping between QtCore keyword and include directory or something..
Please do have a look.
The IDE is made on eclipse.
You can understand what is going wrong if you look closely at the error message:
The error isn’t in your inclusion of
QtCore, but is occurring insideQtCore/qatomic.h, on line 45 (you can find this file in the[YOUR BBNDK DIRECTORY]/target_10_0_9_1673/qnx6/usr/include/qt4/QtCore/qatomic.h):qatomic.his already in theQtCoredirectory, and you’ll find aqglobal.hdirectory there as well. So what this means is that qatomic.h expects the parent directory to be on the include path, so that including<QtCore/qglobal.h>will work.So you just need to add
[YOUR BBNDK DIRECTORY]/target_10_0_9_1673/qnx6/usr/include/qt4to your include directories.Do it like this:
PropertiesC/C++ General/Paths and Symbols[All configurations]Includestag and selectGNU Cin the Languages list (or do this for every language).Add...and type${QNX_TARGET}/usr/include/qt4and pressOKAdd...and type${QNX_TARGET}/usr/include/qt4/QtCoreand pressOKNow your include of #include <QtCore> should work.
Next up: linking errors 😉