Hi Matthias

Thanks for the report.

On 08/06/2016 12:12 PM, Matthias Klose wrote:
>
> gnatbind-6 -shared -E -x /«PKGBUILDDIR»/obj/utests/runner.ali
> gnatlink-6 /«PKGBUILDDIR»/obj/utests/runner.ali -shared-libgcc -lpcsclite -R
> /«PKGBUILDDIR»/lib/static/libpcscada.a -L/usr/lib/ -lahven -o
> /«PKGBUILDDIR»/obj/utests/runner
> /«PKGBUILDDIR»/lib/static/libpcscada.a(pcsc-scard.o): In function
> `pcsc__scard__get_return_code':
> /«PKGBUILDDIR»/src/pcsc-scard.adb:402: undefined reference to 
> `pcsc_stringify_error'
> /«PKGBUILDDIR»/lib/static/libpcscada.a(pcsc-scard.o): In function
> `pcsc__scard__is_valid':
> /«PKGBUILDDIR»/src/pcsc-scard.adb:473: undefined reference to 
> `SCardIsValidContext'
> 
> Here is a workaround
> http://launchpadlibrarian.net/277411681/pcscada_0.7.3-1_0.7.3-1ubuntu1.diff.gz
> 
> however you really should pass '-lpcsclite' behind libpcscada.a.  Isn't there
> anything which allows you to pass this as LIBS, not LDFLAGS?

Does the attached patch work for you?

Kind regards
- reto

>From 1ec12f52a0ef36f1dca6a20009c2691e2c468683 Mon Sep 17 00:00:00 2001
From: Reto Buerki <r...@codelabs.ch>
Date: Sat, 6 Aug 2016 21:24:44 +0200
Subject: [PATCH] Pass external libs as Linker_Options in test project

This fixes build errors on Ubuntu as it has -Wl,--as-needed enabled by
default and somehow gnatmake does not get the ordering right when using
Linker.Default_Switches.
---
 pcscada_utests.gpr | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pcscada_utests.gpr b/pcscada_utests.gpr
index d111386..20c695f 100644
--- a/pcscada_utests.gpr
+++ b/pcscada_utests.gpr
@@ -37,7 +37,7 @@ project PCSCAda_UTests is
    end Compiler;
 
    package Linker is
-      for Default_Switches ("ada") use PCSCAda_Common.Linker_Switches;
+      for Linker_Options use PCSCAda_Common.Linker_Switches;
    end Linker;
 
    package Binder is
-- 
2.1.4

Reply via email to