comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Having trouble with gnatlink
Date: Thu, 26 Nov 2020 08:24:01 +0000	[thread overview]
Message-ID: <lyk0u8y19a.fsf@pushface.org> (raw)
In-Reply-To: 9fb9610e-0b54-4645-ab4e-b4b3bf554674n@googlegroups.com

Pat Van Canada <google@spellingbeewinnars.org> writes:

> I am fooling around a bit today. I used a null terminated record and
> passed it to printf in C code and now I am just fooling around with
> Jim Tcl.
>
> I am having this error:
> /usr/bin/ld: /usr/local/lib/libjim.a(jim.o): in function `Jim_AppendStrings':
> /home/patrick/JIM-DOODLING/jim2/jimtcl/jim.c:2544: undefined reference
> to `__va_start'
[...]
> Does gnatlink add libc by itself when there is C code being linked? I
> am assuming not but I don't know how to add it.

Don't know, but see below

> here is my build.sh
>
> gcc-9 -c   call_printf_src.c  -I/usr/local/include
> gcc-9 -c    pointer_test.adb c.ads

You should have a gnatbind call here to generate the actual main program
& elaboration code.

> gnatlink -o pointer_test -ljim -lm -ldl -shared-libgcc
> pointer_test.ali call_printf_src.o

gnatlink --help suggests that pointer_test.ali and call_printf_src.o
should come before -ljim etc.

And if you want libc, add -lc at the end?

> I don't want to use gprbuild or anything that will hide what is
> happening. I want to learn a little more about compiling Ada.

Use -v or -v -v to see what gnatlink is actually doing.

  reply	other threads:[~2020-11-26  8:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25 23:47 Having trouble with gnatlink Pat Van Canada
2020-11-26  8:24 ` Simon Wright [this message]
2020-11-26 13:27   ` Pat Van Canada
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox