maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Maemo Environment Setting Problem (https://talk.maemo.org/showthread.php?t=5308)

macken 2007-03-16 07:50

Maemo Environment Setting Problem
 
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/howto..._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

Re: Maemo Environment Setting Problem
 
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

Re: Maemo Environment Setting Problem
 
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.


All times are GMT. The time now is 17:51.

vBulletin® Version 3.8.8