[Qt-creator] QSystemInfo Error
dhk
dhkuhl at optonline.net
Thu Aug 19 14:02:09 CEST 2010
On 08/19/2010 07:41 AM, Kirill Krinkin wrote:
> Hello,
>
> have you included next lines in your .pro file?
>
> CONFIG += mobility
> MOBILITY += systeminfo
>
>
> Kirill
>
> On Wed, Aug 18, 2010 at 4:38 PM, dhk <dhkuhl at optonline.net> wrote:
>
>> I just started using Qt and even though this seems like a basic
>> question, I haven't found an answer on the web.
>>
>> When I build the quickstart example I get a QSystemInfo error saying
>> it's not found. What is missing or not configured correctly?
>>
>> Under Options->Qt4 I have Auto-detect Qt in PATH. In my Path I put
>> ~/NokiaQtSDK/QtCreator/bin .
>>
>> I'm using the Nokia_Qt_SDK_Lin64_online_v1_0_en package on a Gentoo
>> linux amd64 box.
>>
>> Thanks,
>>
>> dhk
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-creator
>>
>
>
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
I have that just like the example says.
The quickstart.pro is:
~/NokiaQtSDK/Dev/QuickStart $ cat quickstart.pro
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT += network
CONFIG += mobility
MOBILITY += systeminfo
# Input
SOURCES += main.cpp
symbian {
TARGET.CAPABILITIES = LocalServices ReadUserData WriteUserData
NetworkServices UserEnvironment Location ReadDeviceData
}
The main.cpp is:
~/NokiaQtSDK/Dev/QuickStart $ cat main.cpp
/* See: http://doc.qt.nokia.com/qtmobility-1.0/quickstart.html */
#include <QApplication>
#include <QLabel>
#include <QSystemInfo> //(1)
QTM_USE_NAMESPACE //(2)
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QSystemInfo s;
QLabel *label = new
QLabel(QObject::tr("hello").append(s.currentCountryCode()));
label->show();
label->resize(100,30);
return app.exec();
}
When I run qmake the Makefile is created and then make has the problem.
~/NokiaQtSDK/Dev/QuickStart $ make
g++ -c -pipe -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB
-DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
-I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore
-I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4
-I. -I. -o main.o main.cpp
main.cpp:5:29: error: QSystemInfo: No such file or directory
main.cpp:9: error: expected constructor, destructor, or type conversion
before ‘int’
make: *** [main.o] Error 1
Thanks,
dhk
More information about the Qt-creator-old
mailing list