[gambit-list] Building and linking to a static library

Vijay Mathew vijay.the.lisper at gmail.com
Wed Mar 9 12:14:11 EST 2016


Thanks Marc. I upgraded to v4.8.4 and I am able to build and link the
static library without problems.

--Vijay

On Wed, Mar 9, 2016 at 1:07 AM, Marc Feeley <feeley at iro.umontreal.ca> wrote:

> Yes the two commands (gsc followed by gcc) can (after the fix) be replaced
> by the single invocation of gsc:
>
> gsc -exe -l core/ab.c -ld-options ab.a myapp.scm
>
> Alternatively, you can completely avoid using gcc with the following
> sequence of commands (that also work without the recent fix):
>
> gsc -link -l core/ab.c myapp.scm
> gsc -obj myapp.c
> gsc -obj myapp_.c
> gsc -exe -ld-options ab.a myapp.o myapp_.o
>
> and yes, that is better than invoking gcc explicitly, because it will pass
> the correct options to gcc (or whatever C compiler Gambit was configured
> with).
>
> Marc
>
> > On Mar 8, 2016, at 2:24 PM, Bradley Lucier <lucier at math.purdue.edu>
> wrote:
> >
> > I still don't understand. You're still compiling Gambit-generated code
> with gcc without the correct options.
> >
> > Are you saying that now that gsc is fixed you don't need the second
> command, beginning with "gcc ..."?
> >
> > Brad
> >
> >> On Mar 8, 2016, at 2:20 PM, Marc Feeley <feeley at iro.umontreal.ca>
> wrote:
> >>
> >> Yes, the one that was broken and is now fixed!
> >>
> >> Marc
> >>
> >>> On Mar 8, 2016, at 2:18 PM, Bradley Lucier <lucier at math.purdue.edu>
> wrote:
> >>>
> >>>
> >>>
> >>>> On Mar 8, 2016, at 1:50 PM, Marc Feeley <feeley at iro.umontreal.ca>
> wrote:
> >>>>
> >>>> So after that, you can build your app with the following commands:
> >>>>
> >>>> gsc -link -l core/ab.c myapp.scm
> >>>> gcc -o myapp ab.a `gsc -e '(print (path-expand
> "~~lib/libgambit.a"))'` myapp_.c myapp.c
> >>>
> >>> You probably shouldn't use a bare "gcc" command because it won't have
> the options Gambit-generated code needs for correctness. Isn't there a gsc
> command that does the same thing?
> >>>
> >>> Brad
> >>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20160309/9e105ad9/attachment.htm>


More information about the Gambit-list mailing list