GPS development
Hello all,
I am new to Maemo and need to develop a GPS enabled app for the Nokia N810. I have scratchbox all installed as well as the SDK and have been able to build my own simple programs to understand the toolchain. Now I'm learning more about how GPS is implemented. I found a bunch of example programs that have been helpful at the following svn repository: https://garage.maemo.org/svn/maemoexample/trunk In that bunch of examples there is an example_gps.c that seems nice and straightforward. However, that example doesn't build; it complains of a whole bunch of missing packages and header files. There unfortunately very little information on the Maemo.org site regarding these libraries. I was wondering if perhaps I had an incorrect configuration or perhaps I need to download these packages. Does anyone have an suggestions? The output of my efforts is provided: [sbox-CHINOOK_ARMEL: ~/trunk] > make example_gps gcc -Wall -pedantic `pkg-config --cflags gconf-2.0 hildon-1 hildon-fm-2 hildon-help gtk+-2.0 libosso gdk-2.0 gconf-2.0 gnome-vfs-2.0 gstreamer-0.10 libebook-1.2 libalarm bluez libgwobex libhildondesktop osso-gpsd osso-addressbook-1.0 gpsbt` `pkg-config --libs gconf-2.0 hildon-1 hildon-fm-2 hildon-help gtk+-2.0 libosso gdk-2.0 gconf-2.0 gnome-vfs-2.0 gstreamer-0.10 libebook-1.2 libalarm bluez libgwobex libhildondesktop osso-gpsd osso-addressbook-1.0 gpsbt` -lgstinterfaces-0.10 example_gps.c -o example_gps Package osso-addressbook-1.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `osso-addressbook-1.0.pc' to the PKG_CONFIG_PATH environment variable No package 'osso-addressbook-1.0' found Package gpsbt was not found in the pkg-config search path. Perhaps you should add the directory containing `gpsbt.pc' to the PKG_CONFIG_PATH environment variable No package 'gpsbt' found Package osso-addressbook-1.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `osso-addressbook-1.0.pc' to the PKG_CONFIG_PATH environment variable No package 'osso-addressbook-1.0' found Package gpsbt was not found in the pkg-config search path. Perhaps you should add the directory containing `gpsbt.pc' to the PKG_CONFIG_PATH environment variable No package 'gpsbt' found example_gps.c:2:18: glib.h: No such file or directory example_gps.c:3:21: gtk/gtk.h: No such file or directory example_gps.c:11:19: gpsbt.h: No such file or directory example_gps.c: In function `gps_callback': example_gps.c:21: warning: implicit declaration of function `g_message' example_gps.c: In function `main': example_gps.c:51: error: `gchar' undeclared (first use in this function) example_gps.c:51: error: (Each undeclared identifier is reported only once example_gps.c:51: error: for each function it appears in.) example_gps.c:51: error: syntax error before "error" example_gps.c:54: error: `GMainLoop' undeclared (first use in this function) example_gps.c:54: error: `mainloop' undeclared (first use in this function) example_gps.c:57: error: `gpsbt_t' undeclared (first use in this function) example_gps.c:57: error: syntax error before "ctx" example_gps.c:49: warning: unused variable `status' example_gps.c:50: warning: unused variable `i' example_gps.c:52: warning: unused variable `gpsdata' example_gps.c:53: warning: unused variable `gps_thread' example_gps.c: At top level: example_gps.c:57: warning: ISO C does not allow extra `;' outside of a function example_gps.c:58: warning: type defaults to `int' in declaration of `status' example_gps.c:58: warning: implicit declaration of function `gpsbt_start' example_gps.c:61: error: `error' undeclared here (not in a function) example_gps.c:62: error: `ctx' undeclared here (not in a function) example_gps.c:62: error: initializer element is not constant example_gps.c:62: error: ISO C forbids data definition with no type or storage class example_gps.c:65: error: syntax error before "if" example_gps.c:75: warning: type defaults to `int' in declaration of `gpsdata' example_gps.c:75: warning: initialization makes integer from pointer without a cast example_gps.c:75: error: initializer element is not constant example_gps.c:75: error: ISO C forbids data definition with no type or storage class example_gps.c:76: error: syntax error before "if" example_gps.c:78: error: syntax error before numeric constant example_gps.c:78: warning: type defaults to `int' in declaration of `sleep' example_gps.c:78: error: conflicting types for 'sleep' /usr/include/unistd.h:403: error: previous declaration of 'sleep' was here example_gps.c:78: error: conflicting types for 'sleep' /usr/include/unistd.h:403: error: previous declaration of 'sleep' was here example_gps.c:78: error: ISO C forbids data definition with no type or storage class example_gps.c:79: error: syntax error before string constant example_gps.c:88: warning: type defaults to `int' in declaration of `status' example_gps.c:88: error: redefinition of 'status' example_gps.c:58: error: previous definition of 'status' was here example_gps.c:88: error: `gps_thread' undeclared here (not in a function) example_gps.c:88: warning: passing arg 1 of `gps_set_callback' makes pointer from integer without a cast example_gps.c:88: error: initializer element is not constant example_gps.c:88: error: ISO C forbids data definition with no type or storage class example_gps.c:90: error: syntax error before "if" example_gps.c:96: error: syntax error before string constant example_gps.c:96: warning: type defaults to `int' in declaration of `g_message' example_gps.c:96: error: ISO C forbids data definition with no type or storage class example_gps.c:98: warning: type defaults to `int' in declaration of `mainloop' example_gps.c:98: warning: implicit declaration of function `g_main_new' example_gps.c:98: error: `FALSE' undeclared here (not in a function) example_gps.c:98: error: initializer element is not constant example_gps.c:98: error: ISO C forbids data definition with no type or storage class example_gps.c:99: warning: type defaults to `int' in declaration of `g_main_run' example_gps.c:99: warning: parameter names (without types) in function declaration example_gps.c:99: error: ISO C forbids data definition with no type or storage class example_gps.c:101: error: syntax error before '&' token example_gps.c:101: warning: type defaults to `int' in declaration of `gps_del_callback' example_gps.c:101: error: ISO C forbids data definition with no type or storage class example_gps.c:102: warning: type defaults to `int' in declaration of `gps_close' example_gps.c:102: warning: parameter names (without types) in function declaration example_gps.c:102: error: ISO C forbids data definition with no type or storage class example_gps.c:104: error: syntax error before '&' token example_gps.c:104: warning: type defaults to `int' in declaration of `gpsbt_stop' example_gps.c:104: error: ISO C forbids data definition with no type or storage class make: *** [example_gps] Error 1 [sbox-CHINOOK_ARMEL: ~/trunk] > Thanks in advance for your help, Snowdall |
Re: GPS development
I'm afraid I'm not a Maemo developer (not yet anyway) and I can't answer your question.
But have you looked at GeoClue it looks like it could take care of a lot of the GPS nitty-gritty for you. |
Re: GPS development
I think you need to install some -dev packages.
|
Re: GPS development
Yeah ... I kinda figured I'm missing some of the dev packages. But which ones? I guess I could look at this a bit harder to try to guess.
Thanks for the help, Snowdall |
Re: GPS development
Having done development on-device, I can locate the following files:
Quote:
Quote:
Quote:
|
Re: GPS development
Quote:
Quote:
|
Re: GPS development
No ... there was nothing strange about my scratchbox install, or the install of the SDK either. I selected all the standard defaults during the install process using the install shell scripts. And yes, I would have hoped that all the libraries were included to get done what you want to do. I even reinstalled the SDK and when it asked if I wanted to install the "Nokia binaries" I selected yes (previously I had selected the default "no"). Still it didn't work.
There does seem to be an "apt-get" functionality in sratchbox, which I can only assume could be used to fix this. My only problem is what libraries to ask for. Thanks for the help on this one folks. Snowdall |
Re: GPS development
Ok, this can be a problem with scratchbox. The headers you want are are in seperate folders given the package name. (i think pkg-config is meant to be called to get round this)
but anyway, here is an example to "fix" the gtk error. using a file manager, open: /scratchbox/users/$USER/ and find the folder with the chinook_armel folder. go into usr/include inside the chinook_armel and go into gtk-2.0 and copy the folders inside there into the usr/include folder above it. it shouldn't be hard to figure out what else needs copying. |
Re: GPS development
Unfortunately, copying those header folders over only opened up a larger pandora's box of errors, most being syntax errors in the newly copied header files. I feel there are also some libraries missing in all of this as well ... but I just don't know which ones. I'm falling asleep at my terminal, so I'll have to explore this more tomorrow. Any further ideas are appreciated.
Thanks again, Snowdall |
Re: GPS development
look at the `pkgconf... subcommand. The backquotes say take the output and turn it into arguments.
Just run it normally and it should return what is installed and complain about what is not. Then do (fakeroot) apt-get install libXXX-dev for each missing item (and it might be libbluetooth instead of bluez so you might need to play some games). |
All times are GMT. The time now is 22:17. |
vBulletin® Version 3.8.8