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!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!inka.de!rz.uni-karlsruhe.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:57:02 +0200 Organization: Comp.Center (RUS), U of Stuttgart, FRG Message-ID: <20070326155702.6c20c0b4@cube.tz.axivion.com> References: <20070326151427.296f7b0e@cube.tz.axivion.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: infosun2.rus.uni-stuttgart.de 1174917386 9405 129.69.226.25 (26 Mar 2007 13:56:26 GMT) X-Complaints-To: news@news.uni-stuttgart.de NNTP-Posting-Date: Mon, 26 Mar 2007 13:56:26 +0000 (UTC) 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:14642 Date: 2007-03-26T15:57:02+02:00 List-Id: Alexander Camek wrote: > Okay, after some searching i found in the executable i build before > the symbol :(. Sorry, I do not understand what you mean. > 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. Greetings, Stefan -- Stefan Bellon