GTK on beagle board

hi

I have successfully installed Angstrom Linux for Beagle Board and it
is up and running fine. my goal is to build and run GTK application on
beagle board.

my question is how to install GTK on beagle board and whether GTK is
already present in the image file.

I looked through the root fs and gtk libraries are present it seems
but cairo and pango which will be required for GTK are not present.
as of now i dont need cairo and pango but i need a basic setup by
which am able to compile GTK programs and run on Angstrom linux on
beagle board

I have written a simple hello world application which shows a window
with a button label helloworld..
but when i compile by gcc its giving me #include <gtk/gtk.h> file not
found
i also tried changing the path to just #include <gtk.h>
what could be the problem.

the command line is

gcc -Wfatal-errors \
-mfpu=neon -mfloat-abi=softfp -mcpu=cortex-a8 -fomit-frame-pointer -O3
-fno-math-errno -fno-signed-zeros -fno-tree-vectorize \
-export-dynamic \
-I/usr/include/gtk-2.0 \
-I/usr/lib/gtk-2.0/include \
-I/usr/include/atk-1.0 \
-I/usr/include/cairo \
-I/usr/include/pango-1.0 \
-I/usr/include/glib-2.0 \
-I/usr/lib/glib-2.0/include \
-I/usr/include/freetype2 \
-I/usr/include/libpng12 \
-L/usr/lib \
-Xlinker -rpath -Xlinker /usr/lib \
-I. \
-lm -lpthread \
helloworld.c \
-Xlinker -L/usr/lib -Xlinker -l:libgtk-x11-2.0.so.0 -l:libatk-1.0.so.0
\
-l:libgdk_pixbuf-2.0.so.0 -l:libpango-1.0.so.0 -l:libcairo.so.2 \
-l:libgobject-2.0.so.0 -l:libgmodule-2.0.so.0 -l:libdl.so -
l:libglib-2.0.so.0

this i got it from the link

http://antipastohw.pbworks.com/w/page/27640084/BeagleBoard-GTK-Development

please let me kno the correct procedure

hi

doing a little searching i came to a conclusion that the GTK libraries
are present in the
/usr/lib/ as .so files and one needs to link to .so files which am
doing..
but its not working

can anyone tel me what am doing wrong or my approach is altogether
wrong.

Just curious... have you installed the libs yet?
"gtk+-dev" last I checked.

"opkg list gtk*" should show lots of gtk goodies.

I have done gtk dev easily on BB with Angstrom DEMO and sakoman's
gnome
with no issues. Yes you might have to set a lib path to the gtk libs
with Angstrom.

djlewis

hi

i checked opkg list gtk* and there i get a big list of GTK packages
and gtk+-dev is also present.

so it seems everything is present just some problem with path
u were saying that i need to set the path
can you tell me where exactly and how
i mean to say the exact syntax
it would be better if you give me the exact compilation options

hi

opkg list gtk* is showing gtk+-dev but do i need to install it or its
showing already installed
packages

you should learn opkg options. The option I listed shows what is
available for install, not what is installed.
Type opkg without args to see list of options. there is an option
to show what is installed.

djlewis

my question is how to install GTK on beagle board and whether GTK is
already present in the image file.

Based on other posts it appears they are, however...

gcc -Wfatal-errors \
-mfpu=neon -mfloat-abi=softfp -mcpu=cortex-a8 -fomit-frame-pointer -O3
-fno-math-errno -fno-signed-zeros -fno-tree-vectorize \
-export-dynamic \
-I/usr/include/gtk-2.0 \
-I/usr/lib/gtk-2.0/include \
-I/usr/include/atk-1.0 \
-I/usr/include/cairo \
-I/usr/include/pango-1.0 \
-I/usr/include/glib-2.0 \
-I/usr/lib/glib-2.0/include \
-I/usr/include/freetype2 \
-I/usr/include/libpng12 \
-L/usr/lib \
-Xlinker -rpath -Xlinker /usr/lib \
-I. \
-lm -lpthread \
helloworld.c \
-Xlinker -L/usr/lib -Xlinker -l:libgtk-x11-2.0.so.0 -l:libatk-1.0.so.0
\
-l:libgdk_pixbuf-2.0.so.0 -l:libpango-1.0.so.0 -l:libcairo.so.2 \
-l:libgobject-2.0.so.0 -l:libgmodule-2.0.so.0 -l:libdl.so -
l:libglib-2.0.so.0

This is not the correct way to link libraries on a Linux system. If
Angstrom is configured properly (I don't use it but I suspect it is)
then you would want something like this instead:

-L/usr/lib -lgtk -latk \
-lgdk_pixbuf -lpango -lcairo \
-lgobject -lgmodule -lglib -ldl

Also, if pkg-config is available on your system you can, in your
Makefile, use something like this:

LIBS=`pkg-config --libs gtk+-2.0`

This will generate the appropriate libraries required for using GTK in
your application. You just substitute $(LIBS) where you were previously
using the above link arguments.

This assumes you are not cross compiling and that you are compiling
directly on the BeagleBoard.

hi

thanks for the info
gtk+-dev is not installed
have to install it and check
got the internet connection up and running ok with belkin wireless
Adapter
wiil install and get back to u guys soon..

hi

i have a problem while compiling gtk program on Beagle Board using
Angstrom linux

I have installed everthing related to gtk ,
gtk,
gtk+-dev
all pango and cairo libraries
gcc 4.3 ver

but when i compile my program using the options above then i get the
error

/usr/lib/gcc/arm-angstrom-linux-gnueabi/4.3.3/../../../../arm-angstrom-
linux-gnuabi/bin/ld: cannot find
-lgcc_s

can anyone tell me how to overcome the prob..
am not getting any path related error so i think my compilation
options are correct.

i also tried with a very simple c program without GTK but it is giving
the same prob
i observed that when i only compile the simple program without linking
then it does not give
any prob

hi

I figured it out

just run the commands

before that i reinstalled my gcc but still problem was coming
then i ran these commnads

1) ln -s /lib/libgcc_s.so.1 /lib/libgcc_s.so
2) opkg update
3) opkg install libgcc-s-dev

that did it now i can compile GTK and run program too
one issue remaining regarding some warnings in clearlooks
theme when i run my gtk program but these are minor.

thanks to all those who helped..

cool on figuring out the problem. Yeah, you are correct, you can
ignore the
clearlooks part.
  I wonder what has changed recently if installing
task-sdk-native and the above gtk parts causes difficulty. Here are
the args
I use in Geany ide building locally on my BB.