Reply
Thread Tools
Posts: 10 | Thanked: 0 times | Joined on Aug 2010
#1
Hi there i have some problems to use the following libraries

#include <location/location-gps-device.h>
#include <location/location-location-gpsd-control.h>

Indeed, when i include those 2 on my project a lot of errors came on the compilation because the compiler can't find .h files like gtk, glib, pango, cairo etc...
So i browse my include file in the SDK and found the correct files... SO i add to my .pro INCLUDEPATH += (correct path) and some errors disapeared but it still missing some files like gdkconfig.h , glibconfig.h that doesn't appear at all in the include files...

So i am asking to find some help because that seems strange to me that we can't use the liblocation.

I am working with Windows 7 and Qt Creator so i code in C++...

Additionnal questions:
I have seen many examples code in C and python to use the camera or the gps on the N900 but it still can't be possible to use this features with the cpp libraries no?

Thanks and I hope somebody had the same problem and had solve it...
 
Posts: 180 | Thanked: 76 times | Joined on May 2010
#2
Maybe something like this? I'm not sure if you need all of them...

Code:
CONFIG += link_pkgconfig
PKGCONFIG += glib-2.0 liblocation
LIBS += -llocation
 
Posts: 10 | Thanked: 0 times | Joined on Aug 2010
#3
well that don't seem to work :-(

I have tried the example from : http://wiki.forum.nokia.com/index.ph...on_Example.zip

and there is still some problems of compilation... well it is not a problem of finding .h files but it is something like it doesn't know GLIB_VAR types like guint... i hope that mean something to somebody...
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#4
Please post the compiler error message, otherwise we
can only guess what is the failure.
If the compiler complains about missing or undefined types, you
may have forgotten some includes, like #include <glib.h> for example.

regards
Nicolai
 
Posts: 10 | Thanked: 0 times | Joined on Aug 2010
#5
Code:
from locationinfowidget.cpp:1: 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:422: error: ISO C++ forbids declaration of '__declspec' with no type 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:422: warning: '__declspec' initialized and declared 'extern' 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:422: error: 'dllimport' was not declared in this scope 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:422: error: expected ',' or ';' before 'const' 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:423: error: ISO C++ forbids declaration of '__declspec' with no type 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:423: warning: '__declspec' initialized and declared 'extern' 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:423: error: redefinition of 'int __declspec' 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:422: error: 'int __declspec' previously defined here 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:423: error: 'dllimport' was not declared in this scope 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:424: error: ISO C++ forbids declaration of '__declspec' with no type 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:424: warning: '__declspec' initialized and declared 'extern' 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:424: error: redefinition of 'int __declspec' 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:422: error: 'int __declspec' previously defined here 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:424: error: 'dllimport' was not declared in this scope 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:425: error: ISO C++ forbids declaration of '__declspec' with no type 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:425: warning: '__declspec' initialized and declared 'extern' 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:425: error: redefinition of 'int __declspec' 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:422: error: 'int __declspec' previously defined here 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:425: error: 'dllimport' was not declared in this scope 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:426: error: ISO C++ forbids declaration of '__declspec' with no type 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:426: warning: '__declspec' initialized and declared 'extern' 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:426: error: redefinition of 'int __declspec' 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:422: error: 'int __declspec' previously defined here 
C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gutils.h:426: error: 'dllimport' was not declared in this scope 
In file included from C:/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/include/glib-2.0/glib/gasyncqueue.h:34,
there are errors like these ones... but there is too many lines to put the whole thing...

and here is the .pro file given by the example :

Code:
TEMPLATE = app
TARGET = 
DEPENDPATH += .
INCLUDEPATH += .

CONFIG += link_pkgconfig
PKGCONFIG += glib-2.0 liblocation hildon-1

HEADERS += locationinfowidget.h
SOURCES += locationinfowidget.cpp \
    main.cpp
thanks
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#6
I am not sure but can you try this,
change the first line in locationinfowidget.cpp from:
#include <hildon/hildon-banner.h>
to
extern "C" {
#include <hildon/hildon-banner.h>
}
 

The Following User Says Thank You to nicolai For This Useful Post:
Posts: 432 | Thanked: 645 times | Joined on Mar 2009
#7
Hi,

please check out this example, to see how it should work. The "extern C" mentioned by nicolai should do the trick.

But have you seen the QtMobility APIs for the location? This should be much easier!

Daniel
 

The Following User Says Thank You to danielwilms For This Useful Post:
Posts: 10 | Thanked: 0 times | Joined on Aug 2010
#8
@nicolai still doesn't work...

@danielwilms
This is the example that i am trying to make work...

And i will try to use the QtMobility APIs but i find really strange that i can't compile an official example...
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#9
Originally Posted by Pedrolito View Post
@nicolai still doesn't work...
You get the same error message?
 
Posts: 10 | Thanked: 0 times | Joined on Aug 2010
#10
exactly the same...
 
Reply


 
Forum Jump


All times are GMT. The time now is 09:10.