Reply
Thread Tools
Posts: 4 | Thanked: 1 time | Joined on Jun 2008
#1
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
 
aNoble's Avatar
Posts: 26 | Thanked: 2 times | Joined on Feb 2008 @ Dayton, TN
#2
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.
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#3
I think you need to install some -dev packages.
 
Posts: 4 | Thanked: 1 time | Joined on Jun 2008
#4
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
 

The Following User Says Thank You to snowdall For This Useful Post:
Guest | Posts: n/a | Thanked: 0 times | Joined on
#5
Having done development on-device, I can locate the following files:

Originally Posted by snowdall View Post
example_gps.c:2:18: glib.h: No such file or directory
libglib2.0-dev

Originally Posted by snowdall View Post
example_gps.c:3:21: gtk/gtk.h: No such file or directory
libgtk2.0-dev

Originally Posted by snowdall View Post
example_gps.c:11:19: gpsbt.h: No such file or directory
I guess libgpsbt-dev, but there's no such package available for on-device development. Maybe Scratchbox has more packages available.
 
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#6
I have scratchbox all installed as well as the SDK and have been able to build my own simple programs to understand the toolchain.
example_gps.c:2:18: glib.h: No such file or directory
Hmm, the scratchbox install should install a fair few -dev packages (it's for development after all), and libglib2.0-dev and libgtk2.0-dev really ought to be amongst them. Did you do something odd when installing scratchbox?
 
Posts: 4 | Thanked: 1 time | Joined on Jun 2008
#7
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
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#8
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.
 
Posts: 4 | Thanked: 1 time | Joined on Jun 2008
#9
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
 
tz1's Avatar
Posts: 716 | Thanked: 236 times | Joined on Dec 2007
#10
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).
 
Reply


 
Forum Jump


All times are GMT. The time now is 08:14.