[Glade-users] Using gtkglext



Certainly.  I'm no expert on Makefiles, so I have no idea if this is the
most correct or efficient way of doing it.  This is just what I hacked
together.  I intend at some point to read up on creating Makefiles, but this
works for now.

## Makefile
CC = gcc

INCLUDES = -I/usr/local/include/gtkglext-1.0
-I/usr/local/lib/gtkglext-1.0/include
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include
-I/usr/include/pango-1.0-I/usr/include/glib-
2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo
-I/usr/include/atk-1.0-I/usr/include/libglade-
2.0 -I/usr/include/libxml2

LIBS =  -L/usr/local/lib -L/usr/X11R6/lib -lgtkglext-x11-1.0 -
lgdkglext-x11-1.0 -lGLU -lGL -lXmu -lXt -lSM -lICE -lpangox-1.0 -lglade-2.0-
lgtk-x11-2.0 -lxml2 -lz -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -
lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr
-lXcursor -lXfixes -lpango-1.0 -lcairo -lX11 -lgobject-2.0 -lgmodule-2.0-ldl -
lglib-2.0

SRCFILES = main.c callbacks.c swarm.c glswarm.c

CFLAGS =  -Wl,--export-dynamic

all:
    $(CC) -o swarmsgtk $(SRCFILES) $(INCLUDES) $(CFLAGS) $(LIBS)



On 3/27/07, Mariano Perez-Sauquillo Perera <mithrandir82 at gmail.com> wrote:

Would you mind to show us your own makefile please?
thanks a lot.

On 3/26/07, Dan Swain <dswain at princeton.edu> wrote:

Thanks Derek,  I'm using Glade-2 so your comments are relevant.  I was
able to get things to work nicely using libglade instead of the "build"
option then creating my own makefile, but these comments will surely come in
handy when I get to the point where I want to distribute things.

Thanks again!
- Dan

On 3/26/07, Derek Law < dk7g at yahoo.com.au> wrote:

Hi Dan,

I was using Glade-2 so I don't know if it's going to
any different in Glade-3. Neither do I know if I'm
doing all the things right but at least it worked for
me.  It's just on top of adding the files to
Makefile.am in the src directory (in Glade-2 this is
where the files are stored, on top of the autotools
files and other stuff), I'd add the following in
configure.in

pkg_modules="libglade-2.0 >= 2.5.1"
PKG_CHECK_MODULES(LIBGLADE, [$pkg_modules])
AC_SUBST(LIBGLADE_CFLAGS)
AC_SUBST(LIBGLADE_LIBS)

pkg_modules="gtkglext-1.0 >= 1.0.6 "
PKG_CHECK_MODULES(GTKGL, [$pkg_modules])
AC_SUBST(GTKGL_CFLAGS)
AC_SUBST(GTKGL_LIBS)

for libraries with the .pc files and

OTHERLIB_CFLAGS="-I/path/to/lib/include"
OTHERLIB_LIBS="-L/path/to/lib/lib -lthelibname"

for those without

and add these two lines just before AC_OUTPUT line at
the bottom

CPPFLAGS="-DSOMEDEF $CPPFLAGS  $LIBGLADE_CFLAGS
$GTKGL_CFLAGS $OTHERLIB_CFLAGS"
LIBS="$LIBS $LIBGLADE_LIBS $GTKGL_LIBS $OTHERLIB_LIBS"

AC_OUTPUT([
....

HTH,
: D

I am new to using Glade.  I understand how to build
a simple interface, add
callback functions, etc, and how to build and make
the code to generate an
executable.  If I need to add functionality from an
additional library (in
this case gtkglext) to my program, how can I update
the Makefiles, etc to
reflect the correct build options?  To build a
single program it works to do

gcc -o someprog someprog.c `pkg-config --cflags
--libs gtkglext-1.0
libglade-2.0`

but I want to be able to use the more sophisticated
system for bigger
projects.  Just adding the code and running
./autogen.sh and make doesn't
work - it comes up with

error: gtk/gtkgl.h: No such file or directory

I've tried checking out the examples included in the
gtkglext source but it
doesn't really indicate what to do for actual
implementation with glade.

TIA,
- Dan


Send instant messages to your online friends
http://au.messenger.yahoo.com
_______________________________________________
Glade-users maillist  -   Glade-users at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-users



_______________________________________________
Glade-users maillist  -  Glade-users at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-users



_______________________________________________
Glade-users maillist  -  Glade-users at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20070327/8bf3d349/attachment.html 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]