From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.unit0.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: hreba Newsgroups: comp.lang.ada Subject: Re: Example Ada calling Gnu Scientific Library (GSL) Date: Sun, 9 Apr 2017 12:57:25 +0200 Message-ID: References: <2b035819-e55e-4805-9ff1-a2cec09f13e0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net ziSbfuzF3qc8J/mGrAN39Q89+SGtdDLaadH4tDonLo5BQYtG7m Cancel-Lock: sha1:UY62JHuqPZUVtWUXlPuZcm84OZs= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:46550 Date: 2017-04-09T12:57:25+02:00 List-Id: On 04/08/2017 10:28 AM, Simon Wright wrote: > hreba writes: > >> The missing function is declared in src/gsl_gsl_integration_h.ads as >> >> function gsl_integration_qng >> (f : access constant gsl_gsl_math_h.gsl_function; >> a : double; >> b : double; >> epsabs : double; >> epsrel : double; >> result : access double; >> abserr : access double; >> neval : access stddef_h.size_t) return int; >> pragma Import (C, gsl_integration_qng, "gsl_integration_qng"); > > What the pragma Import says is that gsl_integration_qng is imported from > some place else, presumably the C library you've asked gcc to generate a > skinny binding to. > > Here, gsl 2.3, the symbol is in libgsl. > > nm -Aa libgl.a | grep gsl_integration_qng > > says > > libgsl.a:qng.o: 00000000000000c0 T _gsl_integration_qng > > I don't think the leading underscore is your problem, GNAT knows when > the platform (macOS here) needs the leading underscore. > My directory structure is └── Num <-- thick bindings ├── gsl.gpr ├── GSL_Raw <-- thin bindings │ ├── gsl_raw.gpr │ ├── lib │ │ ├── alloca_h.ali │ │ ├── gsl_gsl_integration_h.ali ... │ ├── obj │ │ ├── alloca_h.ali │ │ ├── alloca_h.o ... │ ├── readme.txt │ └── src │ ├── alloca_h.ads │ ├── gsl_gsl_integration_h.ads ... ├── lib │ ├── gsl.ali │ └── libgsl.a ├── num.gpr ├── obj │ ├── auto.cgpr │ ├── b__gsl.adb ... ├── src │ ├── gsl.adb │ ├── gsl.ads │ ├── numfunc.adb │ └── numfunc.ads ... So, sitting in directory Num: nm -Aa GSL_Raw/lib/libgsl_raw.a | grep gsl_integration_qng says nothing. nm -Aa lib/libgsl.a | grep gsl_integration_qng says nothing nm -Aa /usr/lib/libgsl.a | grep gsl_integration_qng says /usr/lib/libgsl.a:qng.o:0000000000000000 T gsl_integration_qng > I hate to ask this, but have you actually linked with -lgsl? > Where, how? I have 3 project files now: 1. in Num/GSL_Raw for the thin binding 2. in Num for the thick binding 3. in the directory of my test program To the first one using your suggestion on 04/05/2017, I added: package Builder is for Default_Switches ("C") use ("-lgsl"); end Builder; but it didn't help. (Sigh) -- Frank Hrebabetzky +49 / 6355 / 989 5070