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=0.6 required=5.0 tests=BAYES_00,FROM_WORDY autolearn=no 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!news.karotte.org!news2.arglkargh.de!noris.net!news1.nefonline.de!not-for-mail From: "Alexander Camek" Newsgroups: comp.lang.ada Subject: Re: Undefined reference to glib_E Date: Mon, 26 Mar 2007 16:45:12 +0200 Organization: NEFkom - Mnet Telekommunikations GmbH Message-ID: References: <20070326151427.296f7b0e@cube.tz.axivion.com> <20070326155702.6c20c0b4@cube.tz.axivion.com> NNTP-Posting-Host: pleione.3soft.de X-Trace: news1.nefonline.de 1174920238 15414 212.114.211.8 (26 Mar 2007 14:43:58 GMT) X-Complaints-To: usenet@news1.nefonline.de NNTP-Posting-Date: Mon, 26 Mar 2007 14:43:58 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-RFC2646: Format=Flowed; Original X-NNTP-Posting-Host: 10.1.1.39 Xref: g2news1.google.com comp.lang.ada:14643 Date: 2007-03-26T16:45:12+02:00 List-Id: "Stefan Bellon" 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