Problems Cross Compiling - Cant Find Glib.h


hamfletta

Still Fresh
Joined
Jun 30, 2010
Messages
3
Hi guys,

I have never ported a program before and I thought I would give it a go! I have managed to set up a cross compiler and build a hello world program which worked on my pandora. (used the scripts from the wiki to do this). My problem came when I tried to compile a program! for my first port attempt I chose Geany. (I want to do some simple python coding on the go and I kind of like geany :rolleyes: ).

I configured it with this command

Code:
./configure --host=arm-none-linux-gnueabi

I then ran make but got this error

Code:
lregex.c:22: fatal error: glib.h: No such file or directory

I had a look at the Makefile and saw

Code:
GIO_CFLAGS = -pthread -I/usr/local/pandora/arm-2009q3/usr/include/glib-2.0 -I/usr/local/pandora/arm-2009q3/usr/lib/glib-2.0/include

That dir does in fact contain glib.h. In fact it has the same files as my /usr/include/glib-2.0 folder. I have messed around with --prefx but no joy. From my limited knowledge the -I option sets include path for the compiler? But GIO_CFLAGS does not seem right.

Clearly it can not find glib.h but I have no idea why. I have a feeling that I need to tell it where to find the includes but being a noob i have no idea how to do that! I was thinking hacking around the makeflie (maybe CFLAGS??) is the answer?

Most of my coding has been in Java or in a IDE so I have zero experience of makefiles other than how to compile things for my normal linux box. I want to explore the desktop capabilities of the pandora as I think the games / emulation is pretty much covered!

Sorry for the noob question!!
 
pandoraDetox said:
Hi guys,

I have never ported a program before and I thought I would give it a go! I have managed to set up a cross compiler and build a hello world program which worked on my pandora. (used the scripts from the wiki to do this). My problem came when I tried to compile a program! for my first port attempt I chose Geany. (I want to do some simple python coding on the go and I kind of like geany :rolleyes: ).

I configured it with this command

Code:
./configure --host=arm-none-linux-gnueabi

I then ran make but got this error

Code:
lregex.c:22: fatal error: glib.h: No such file or directory

I had a look at the Makefile and saw

Code:
GIO_CFLAGS = -pthread -I/usr/local/pandora/arm-2009q3/usr/include/glib-2.0 -I/usr/local/pandora/arm-2009q3/usr/lib/glib-2.0/include

That dir does in fact contain glib.h. In fact it has the same files as my /usr/include/glib-2.0 folder. I have messed around with --prefx but no joy. From my limited knowledge the -I option sets include path for the compiler? But GIO_CFLAGS does not seem right.

Clearly it can not find glib.h but I have no idea why. I have a feeling that I need to tell it where to find the includes but being a noob i have no idea how to do that! I was thinking hacking around the makeflie (maybe CFLAGS??) is the answer?

Most of my coding has been in Java or in a IDE so I have zero experience of makefiles other than how to compile things for my normal linux box. I want to explore the desktop capabilities of the pandora as I think the games / emulation is pretty much covered!

Sorry for the noob question!!

Please read this first.
So the hackish solution is to change your CPPFLAGS and rerun autoconfig.

The cool solution would have been to fix $PNDSDK/usr/bin/glib-config, so configure find it. But as most distro put glib and gtk in the same dir, this configure omit to check where is glib anyway.
check this :
Code:
seb@seb:/tmp/geany$ grep PKG_CONFIG config.log
configure:16094: $PKG_CONFIG --exists --print-errors "$gtk_modules"
configure:16110: $PKG_CONFIG --exists --print-errors "$gtk_modules"
configure:16187: $PKG_CONFIG --exists --print-errors "$gio_modules"
configure:16203: $PKG_CONFIG --exists --print-errors "$gio_modules"
ac_cv_env_PKG_CONFIG_LIBDIR_set=
ac_cv_env_PKG_CONFIG_LIBDIR_value=
ac_cv_env_PKG_CONFIG_PATH_set=
ac_cv_env_PKG_CONFIG_PATH_value=
ac_cv_env_PKG_CONFIG_set=
ac_cv_env_PKG_CONFIG_value=
ac_cv_path_PKG_CONFIG=/usr/local/pandora/arm-2009q3/bin/arm-none-linux-gnueabi-pkg-config
PKG_CONFIG='/usr/local/pandora/arm-2009q3/bin/arm-none-linux-gnueabi-pkg-config'
PKG_CONFIG_LIBDIR='
PKG_CONFIG_PATH='

Edit: welcome :)

Edit 2: I forgot, you should set --prefix=/mnt/utmp/geany (if you plan to set "geany" as appdata in the pxml)
 
Last edited by a moderator:
Back
Top