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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1e18e59d68dcb061 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.germany.com!news.belwue.de!news.uni-stuttgart.de!not-for-mail From: Stefan Bellon Newsgroups: comp.lang.ada Subject: Re: Undefined reference to glib_E Date: Mon, 26 Mar 2007 15:14:27 +0200 Organization: Comp.Center (RUS), U of Stuttgart, FRG Message-ID: <20070326151427.296f7b0e@cube.tz.axivion.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: infosun2.rus.uni-stuttgart.de 1174914844 9405 129.69.226.25 (26 Mar 2007 13:14:04 GMT) X-Complaints-To: news@news.uni-stuttgart.de NNTP-Posting-Date: Mon, 26 Mar 2007 13:14:04 +0000 (UTC) To: "Alexander Camek" In-Reply-To: X-Newsreader: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; i486-pc-linux-gnu) X-URL: http://www.axillion.de/ Xref: g2news1.google.com comp.lang.ada:14640 Date: 2007-03-26T15:14:27+02:00 List-Id: 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