From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!news.mixmin.net!aioe.org!0nYzhFpEeoH2MFWixtUlcg.user.gioia.aioe.org.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Having trouble with gnatlink Date: Thu, 26 Nov 2020 08:24:01 +0000 Organization: Aioe.org NNTP Server Message-ID: References: <9fb9610e-0b54-4645-ab4e-b4b3bf554674n@googlegroups.com> NNTP-Posting-Host: 0nYzhFpEeoH2MFWixtUlcg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin) X-Notice: Filtered by postfilter v. 0.9.2 Cancel-Lock: sha1:5I5tV3O4odEBHDI3jnulvXlA2gs= Xref: reader02.eternal-september.org comp.lang.ada:60620 List-Id: Pat Van Canada 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.