Linker error with dmd when trying to generate wxWidgets wrapper on Windows (msys2/mingw-w64)

Vincent R via Digitalmars-d digitalmars-d at puremagic.com
Thu Nov 26 12:49:25 PST 2015


Hi,

I have a problem to generate D wrapper for wxWidgets (wxD) on 
msys2/mingw64.
Here is how to reproduce it:

1) Install msys2 from here http://msys2.github.io/

2) Launch msys2 terminal and add dmc/dmd to PATH

$ mkdir tmp && cd tmp
$ export 
PATH="C:\Developer\D\dm\bin":"C:\Developer\D\dmd2\windows\bin":$PATH
$ wget 
https://github.com/wxWidgets/wxWidgets/releases/download/v2.8.12/wxWidgets-2.8.12.tar.gz
$ cd wxWidgets-2.8.12/build/msw
$ make -f makefile.dmc
$ export WXDIR=/home/Vincent/tmp/wxWidgets-2.8.12
$ cd ~/tmp
$ git clone https://github.com/vrichomme/wxd.git
$ cd wxd/src
$ make
...
Warning: Public 
'_D2wx8TreeCtrl10TreeItemId6__ctorMFPvZC2wx8TreeCtrl10TreeItemId' 
already in library, redefinition ignored.

Then when I try to generate some samples I have an error about 
the same symbol:

$ cd Samples/

dmd -c -version=wx28 -version=__WXMSW__ -version=ANSI -I..\.. 
Font.d
Font.d(15): Deprecation: module std.stream is deprecated - It 
will be removed from Phobos in October 2016. If you still need 
it, go to https://github.com/DigitalMars/undeaD
..\..\wx\common.d(151): Deprecation: function 
wx.common.new_Rectangle is deprecated
..\..\wx\common.d(151): Deprecation: function 
wx.common.new_Rectangle is deprecated
Font.d(667): Deprecation: implicitly overriding base class method 
wx.FontMisc.FontEnumerator.Facenames with 
Font.MyFontEnumerator.Facenames deprecated; add 'override' 
attribute

dmd -g -of..\..\bin\Font.exe Font.obj ..\..\wxd.lib ..\..\wxc.lib 
C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxbase28d.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxbase28d_xml.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_core.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_adv.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_html.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxmsw28d_xrc.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxtiffd.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxjpegd.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxpngd.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxzlibd.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxregexd.lib  C:/Developer/msys64/home/Vincent/tmp/wxWidgets-2.8.12\lib\dmc_lib\wxexpatd.lib   kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib odbc32.lib    -L/EXETYPE:NT -L/SU:WINDOWS:4.0
OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
..\..\wxd.lib(TreeCtrl)  Offset B471FH Record Type 00C3
  Error 1: Previous Definition Different : 
_D2wx8TreeCtrl10TreeItemId6__ctorMFPvZC2wx8TreeCtrl10TreeItemId
C:\Developer\msys64\home\Vincent\tmp\wxWidgets-2.8.12\lib\dmc_lib\wxbase28d.lib(dircmn)
  Error 168: >64K Global Types


So I don't know if the bug is inside the wrapper or the 
compiler/linker.
I should add that I have the same issue with gdc.

Need someone to look at it.

Thanks







More information about the Digitalmars-d mailing list