Linking error with locale symbols

Iain Buclaw ibuclaw at ubuntu.com
Fri Sep 7 23:40:52 PDT 2012


On 7 September 2012 22:57, Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:
> On 9/7/12, Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:
>> I'm having linking errors on win32 for a couple of static members in C++
>> stdlib.
>
> I can see now why, g++ by default links statically to stdlib, but gdc
> links dynamically. The import lib for stdlib doesn't have the
> '_S_lc_ctype_c_locale' symbol. I'm not sure why though.. shouldn't the
> static and dynamic libs both have the same exported symbols?
>
> As a workaround, how do I force the LD linker to link to the static
> rather than the dynamic library?

>From 'man gcc'

Linker Options
   object-file-name  -llibrary -nostartfiles  -nodefaultlibs
-nostdlib -pie -rdynamic -s  -static  -static-libgcc
-static-libstdc++
   -shared -shared-libgcc  -symbolic -T script  -Wl,option  -Xlinker
option -u symbol


I would place a bet on -static-libstdc++   :^)


Regards
-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the D.gnu mailing list