comp.lang.ada
 help / color / mirror / Atom feed
From: Stefan Bellon <sbellon@sbellon.de>
To: "Alexander Camek" <Alexander.Camek@Elektrobit.com>
Subject: Re: Undefined reference to glib_E
Date: Mon, 26 Mar 2007 15:14:27 +0200
Date: 2007-03-26T15:14:27+02:00	[thread overview]
Message-ID: <20070326151427.296f7b0e@cube.tz.axivion.com> (raw)
In-Reply-To: <newscache$braifj$wrj$1@pleione.3soft.de>

Alexander Camek wrote:

> with "common";
> with "framework";
> 
> project images is
>  for Library_Name use "images";
>  for Library_Dir  use "lib";
>  for Object_Dir   use "obj";
>  for Library_Kind use "dynamic";
>  for Source_Dirs  use (".", "bind");
>  for Languages    use ("Ada", "C");
>  for Library_Interface use
>   ("base_images", "generic_images", "images");
> 
>  package Linker   renames Common.Linker;
>  package Compiler renames Common.Compiler;
>  package Builder  renames Common.Builder;
>  package Ide      renames Common.Ide;
> 
> end images;
> 
> When I do a static linking, everything works fine, but the dynamic
> linkage has this undefined reference.

You are building a DLL on Windows here. A DLL cannot (unlike a
shared object on UNIX) have unresolved symbols. In the worst case you
need an import library. But in this case, there's another way.

> The common project contains the gtkada project.

Somewhere in your GtkAda project file there should be the Linker
package and the Linker_Options defined. Those are necessary when
building a DLL on Windows. In our project files it looks like this:

with "gtkada";

-- ...

project My_Lib is

   for Library_Name use "My_Lib";
   for Library_Kind use "dynamic";

   -- ...

   case Common.OS is
      when "UNIX" =>
         null;
      when "Windows_NT" =>
         --  On Windows, we need to use GtkAda's Linker_Options to
         --  link DLLs depending upon GtkAda.
         for Library_Options use GtkAda.Linker'Linker_Options;
   end case;

   -- ...

end My_Lib

I hope, this helps.

Greetings,
Stefan

-- 
Stefan Bellon



  reply	other threads:[~2007-03-26 13:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-26 10:35 Undefined reference to glib_E Alexander Camek
2007-03-26 13:14 ` Stefan Bellon [this message]
2007-03-26 13:43   ` Alexander Camek
2007-03-26 13:57     ` Stefan Bellon
2007-03-26 14:45       ` Alexander Camek
replies disabled

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