guile-devel
[Top][All Lists]
Advanced

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

Re: Passing C pointers through guile


From: Kjetil S. Matheussen
Subject: Re: Passing C pointers through guile
Date: Wed, 9 Jul 2008 20:32:27 +0200 (CEST)

On Wed, 9 Jul 2008, Kjetil S. Matheussen wrote:

> 
> Ludovic Court?s:
> > scenes.
> > 
> > > I agree with Maciek that it would at least be mind-comforting to have
> > > functions like scm_to_ptr/etc, although not strictly necessary,
> > > since using integers works just fine.
> > 
> > `scm_{to,from}_uintptr ()' could be handy (patches welcome!).
> > 
> 
> I gave it a try. Unfortunately, I was completely unable to create
> the configure file right now, so the patch is against 1.8.5 (sorry
> if this creats trouble against git repository), and
> it's also untested, since I couldn't build configure. However,
> the patches are trivial, so I think they work anyway. (crossing fingers)
> 

Stupid me. I could of course compile 1.8.5 since I have autoconf 1.60.
And by doing that, I found three trivial typos. New version of
http://www.notam02.no/~kjetism/libguile.diff is uploaded.

However, I can't get it to work...:

"
address@hidden ~/guile-1.8.5 $ CFLAGS=-O3 ./configure 
--prefix=/home/kjetil/guile-1.8.5 --without-threads
...
address@hidden ~/guile-1.8.5 $ make && make install
...
address@hidden ~/guile-1.8.5 $ more test.c
#include <libguile.h>
#include <libguile/numbers.h>

int main(){
  SCM t=scm_from_uintptr((scm_t_uintptr)&main);
  scm_t_uintptr m=scm_to_uintptr(t);
  printf("main: %p, p: %x\n",&main,m);
  return 0;
}

address@hidden ~/guile-1.8.5 $ gcc -Iinclude/ -Llib lib/libguile.a test.c
/tmp/ccMcEAxd.o: In function `main':
test.c:(.text+0x1b): undefined reference to `scm_from_uintptr'
test.c:(.text+0x2c): undefined reference to `scm_to_uintptr'
collect2: ld returned 1 exit status
address@hidden ~/guile-1.8.5 $
"

Any idea why?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]