This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Guile tutorial available


sen_ml@eccosys.com writes:

> DMD> I've written a Guile tutorial, aimed at C programmers who want to use 
> DMD> Guile as an extension language.  It's at:
> DMD> http://freespace.virgin.net/david.drysdale/guile/tutorial.html
> 
> > i'm reading through the tutorial right now and haven't located any
> > compilation instructions for the code.  i would appreciate addition of
> > such instructions.
> 
> for debian gnu/linux (frozen), what worked for me for tortoise1.c was:
> 
>   gcc -L/usr/X11R6/lib -lX11 -lm tortoise1.c -o tortoise1
> 
> and for tortoise2.c:
> 
>   gcc -L/usr/X11R6/lib -lX11 -lm -lguile -lqthreads -ldl tortoise2.c \
>       -o tortoise2

Since the issue of "what do I link against" pops up constantly,
despite there being a documented policy for this, and reams of closed
out falsely reported bugs in the Deban Bug database about libguile not
linking with libqthreads, I'll write up what I put in all the bug
reports.

The proper way to do this is to use guile-config.  So for tortoise2.c
wen you compile and link in the same step try this:

gcc `guile-config compile` -L/usr/X11R6/lib -lX11 \
    `guile-config link` tortoise2.c -o tortoise2

On a Debian box you get the following:

gcc -I/usr/include -L/usr/X11R6/lib -lX11 \
    -L/usr/lib -lguile -lqthreads -ldl -lm tortoise2.c -o tortoise2

This is the recommended way for several reasons.  The most pressing
are that it is portable across machines that both support and don't
support qthreads.  This is important in Debian because some
architectures don't support qthreads.

If we areincluding compilation instructions in the tutorial, we should
prolly include the use of guile-config, otherwise we're just going to
be propogating problematic behavior some more.

-- 
Craig Brozefsky                      <craig@red-bean.com>
Free Scheme/Lisp Software  http://www.red-bean.com/~craig
"Hiding like thieves in the night from life, illusions of 
oasis making you look twice.   -- Mos Def and Talib Kweli

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]