PDA

View Full Version : Maemo Environment Setting Problem


macken
2007-03-16, 07:50
Hi all,

I am new to all the linux material, I recently got a second hand 770 and have been trying to set up the develop environment to write some programs for my interest.

I follow the instruction,
http://maemo.org/platform/docs/howtos/Maemo_tutorial.html (I am using ver 2.2)
Setup the scratchbox successfully and had the Maemo UI running properly. Now I got the maemo_hello.c code and try to compile it following the instruction:
gcc -o maemo_hello maemo_hello.c `pkg-config --cflags gtk+-2.0 hildon-libs` -ansi -Wall `pkg-config --libs gtk+-2.0 hildon-libs`

and I got a lot errors, which, I suppose, is cause by the wrong directory in the include file:

maemo_hello.c has the follow:
#include <hildon-widgets/hildon-program.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkbutton.h>

and I found that I shoud have
#include <gtk-2.0/gtk/gtkmain.h>
#include <gtk-2.0/gtk/gtkbutton.h>
instead, I have the directory called gtk-0.2 rather than just gtk

same thing happens in the hildon-program.h file,
it has other #include calling the gdk, glib, gtk etc.. but I have glib-2.0, gtk2.0 , etc in my system instead.

Does anybody had the same problem b4? how do you deal with it? Do I need to change all the heading one by one?

Thanks a lot.

spycedtx
2007-03-18, 06:17
Actually, if you move to an autoconf/make build situation, you can specify the libraries you'll be using in your configuration files, and when you run autoconf/configure, it'll expand and correct the directory structures properly. This way you can include gtk/*, rather than gtk-x.y

spycedtx
2007-03-18, 06:22
how about I bother to post a link, rather than mumble crazy !

http://autotoolset.sourceforge.net/tutorial.html#SEC50

Or, google for "tutorial autoconf automake" to start you off.