[Chicken-users] static library and link

2006-05-22 Thread Frederic Peschanski
Hello, I am working on a library (maybe an egg at some point) for chicken. I have some record of scheme programming but I am new to chicken. My initial plan, in order to be portable across linux and cygwin, was to compile a static library e.g. mylib.a from the .scm (and .c and .o) files. For t

Re: [Chicken-users] static library and link

2006-05-22 Thread Thomas Chust
On Mon, 22 May 2006, Frederic Peschanski wrote: [...] My initial plan, in order to be portable across linux and cygwin, was to compile a static library e.g. mylib.a from the .scm (and .c and .o) files. Hello, maybe I'm missing something here, but why should it be a problem on either cygwin

Re: [Chicken-users] static library and link

2006-05-23 Thread Frédéric Peschanski
Thank you thomas for your insightful answer. Sadly I tried again and now I have different but still undefined symbols (only one in fact : C_pischeme_toplevel) What I understand is that I am probably wrong with the whole process. So let's rethink the plan and explanation. What I want to do is to

Re: [Chicken-users] static library and link

2006-05-23 Thread Thomas Chust
On Tue, 23 May 2006, Frédéric Peschanski wrote: Thank you thomas for your insightful answer. Sadly I tried again and now I have different but still undefined symbols (only one in fact : C_pischeme_toplevel) Hello Frédéric, that surprises me a little. At least the top level of the explicitly

Re: [Chicken-users] static library and link

2006-05-23 Thread felix winkelmann
On 5/23/06, Frédéric Peschanski <[EMAIL PROTECTED]> wrote: ==> mylib.scm (declare (unit mylib)) (declare (export (foo bar))) That should be `(declare (export foo bar))' (typo?) ==> myexample.scm (load-library 'mylib "mylib.so") (bar) Probably there are missing links between the library fil

Re: [Chicken-users] static library and link

2006-05-23 Thread John Cowan
felix winkelmann scripsit: > Not at all dumb - the documentation is a bit weak on that. Can you lay out for us the principles behind what's built-in, what's in a unit, and what ought to go in an egg? -- John Cowanhttp://www.ccil.org/~cowan [EMAIL PROTECTED] Please leave your va

Re: [Chicken-users] static library and link

2006-05-23 Thread felix winkelmann
On 5/24/06, John Cowan <[EMAIL PROTECTED]> wrote: felix winkelmann scripsit: > Not at all dumb - the documentation is a bit weak on that. Can you lay out for us the principles behind what's built-in, what's in a unit, and what ought to go in an egg? Ok, say we have the following files: ; x.s

Re: [Chicken-users] static library and link

2006-05-24 Thread John Cowan
felix winkelmann scripsit: > The simplest model is static linking - we just compile the library units > into object files and link them with out application: > > % csc -c x.scm > % csc -c y.scm > % csc z.scm x.o y.o -o z I'm with you so far. > We can also combine multiple library units into a s

Re: [Chicken-users] static library and link

2006-05-24 Thread Thomas Chust
On Wed, 24 May 2006, felix winkelmann wrote: On 5/23/06, Frédéric Peschanski <[EMAIL PROTECTED]> wrote: [...] Finally, I don't really understand which commands I should use for compilation : [...] - of the library .o ==> .so csc X.o Y.o -s -o libXY.so [...] Hello, as I already pointed

Re: [Chicken-users] static library and link

2006-05-24 Thread felix winkelmann
On 5/24/06, John Cowan <[EMAIL PROTECTED]> wrote: > We can also combine multiple library units into a static library: > > % ar cru libxy.a x.o y.o > % csc z.scm -L. -lxy This, however, pukes on Cygwin as follows: ./libxy.a(y.o): In function `C_y_toplevel': /tmp/y.c:56: undefined reference to `

Re: [Chicken-users] static library and link

2006-05-24 Thread Thomas Chust
On Wed, 24 May 2006, John Cowan wrote: felix winkelmann scripsit: [...] We can also combine multiple library units into a static library: % ar cru libxy.a x.o y.o % csc z.scm -L. -lxy This, however, pukes on Cygwin as follows: [...] Hello, this again looks like Win32 mixed linkage proble

Re: [Chicken-users] static library and link

2006-05-24 Thread Sven . Hartrumpf
Wed, 24 May 2006 12:13:25 + (GMT), chust wrote: > as I already pointed out in my earlier reply to this thread (which is > apparently, like so often these days, delayed forever by the mailing list > software) Not the software, it's us, the moderators who sometimes get lost among 20 spam mails

Re: [Chicken-users] static library and link

2006-05-24 Thread Thomas Chust
On Wed, 24 May 2006, [EMAIL PROTECTED] wrote: Wed, 24 May 2006 12:13:25 + (GMT), chust wrote: as I already pointed out in my earlier reply to this thread (which is apparently, like so often these days, delayed forever by the mailing list software) Not the software, it's us, the moderator

Re: [Chicken-users] static library and link

2006-05-24 Thread John Cowan
Thomas Chust scripsit: > this again looks like Win32 mixed linkage problems. Try linking with the > static chicken libraries by doing at least > > csc -static-libs z.scm -L. -lxy Works. Thanks. > or even > > csc -static z.scm -L. -lxy Also works. Felix Winkelmann scripsit: > >*** Shel

Re: [Chicken-users] static library and link

2006-05-26 Thread Frederic Peschanski
Hello all Thanks yo all for your very insightful explanations, I begin to understand the way things are working. I also understand that cygwin is a little bit more "picky". For example, if I use Thomas' makefile, everything get compiled on both cygwin and linux. On linux everything works fine

Re: [Chicken-users] static library and link

2006-05-28 Thread felix winkelmann
On 5/26/06, Frederic Peschanski <[EMAIL PROTECTED]> wrote: Error: unbound variable: mylib Call history: (define-extension mylib (export foo bar)) <-- = Anyway, I am progressing, thank you again ! Fred. Hm... This seems to indicate that your chicken doesn't understa