From: "Alexander Camek" <Alexander.Camek@Elektrobit.com>
Subject: Re: Undefined reference to glib_E
Date: Mon, 26 Mar 2007 16:45:12 +0200
Date: 2007-03-26T16:45:12+02:00 [thread overview]
Message-ID: <newscache$a9mifj$n13$1@pleione.3soft.de> (raw)
In-Reply-To: 20070326155702.6c20c0b4@cube.tz.axivion.com
"Stefan Bellon" <sbellon@sbellon.de> schrieb im Newsbeitrag
news:20070326155702.6c20c0b4@cube.tz.axivion.com...
> Alexander Camek wrote:
>> So it seems i have to use an import library, because it seems that
>> the build will not work like under unix.
>> I first build under unix my "executable" and then use many shared
>> objects.
>
> If you build DLLs, then those DLLs need to see all symbols they refer
> to. If they depend on other DLLs, that's usually no problem ...
>
>> Do I need in that case the previous named "import library", because
>> windows is doing the whole a little bit diffrent?
>
> ... but when your DLL indeed depends on the main executable, then you
> need an import library. We have such a case as well. In the Linker
> section of the main executable we have:
>
> package Linker is
> case Common.Target_OS is
> when "linux-gnu" =>
> for Default_Switches ("ada") use
> Common.Linker'Default_Switches ("ada") &
> "-Wl,--export-dynamic";
> when "solaris2.8" | "solaris2.9" | "solaris2.10" =>
> for Default_Switches ("ada") use
> Common.Linker'Default_Switches ("ada");
> when "mingw32" | "cygwin" =>
> for Default_Switches ("ada") use
> Common.Linker'Default_Switches ("ada") &
> "-Wl,--export-all-symbols,--out-implib,main.lib";
> end case;
> end Linker;
>
> On GNU/Linux you need the --export-dynamic if you need to get at the
> symbols of the main executable from plugins you load via dlopen. On
> Solaris this is default. On Windows, you can see the commands that
> generate the import library.
>
> Then, in the library that depends on the symbols of the main
> executable, we have the following in the project file:
>
> case Common.OS is
> when "UNIX" =>
> null;
> when "Windows_NT" =>
> for Library_Options
> use GtkAda.Linker'Linker_Options &
> (Common.Global_Obj & "main.lib");
> end case;
>
> The Common.Global_Obj is the object directory of your main project as
> the import library has been placed there.
>
> I hope this helps.
Yes, this was my problem. Thanks for your help. Now I can build the whole.
Greetings
Alexander
prev parent reply other threads:[~2007-03-26 14:45 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
2007-03-26 13:43 ` Alexander Camek
2007-03-26 13:57 ` Stefan Bellon
2007-03-26 14:45 ` Alexander Camek [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox