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 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!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Example Ada calling Gnu Scientific Library (GSL) Date: Sat, 08 Apr 2017 09:28:17 +0100 Organization: A noiseless patient Spider Message-ID: References: <2b035819-e55e-4805-9ff1-a2cec09f13e0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="2b83c84756a8be78cf5c0ef8aef783fb"; logging-data="17213"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/GaaTzlpvkgAYmodRWfvVr9pjC0L18CLs=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (darwin) Cancel-Lock: sha1:tcN3fw9teLYg8qAJpprfKkdvvZ4= sha1:S8KceBgT4N8IJP1RcIDmFkLXK7s= Xref: news.eternal-september.org comp.lang.ada:46541 Date: 2017-04-08T09:28:17+01:00 List-Id: 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. I hate to ask this, but have you actually linked with -lgsl?