Generate wxD with dmc/dmd

Vincent R via Digitalmars-d digitalmars-d at puremagic.com
Sat Nov 7 14:12:53 PST 2015


Hi,

I am trying to generate the wxWidgets wrapper wxD on Windows 
through msys/mingw64(or cygwin).
So I have downloaded wxWidgets-2.8.12 and dmd c++/d compiler 
respectively dmc/dmd but I still have an error.
Let's consider we are using cygwin:

$ export 
PATH="C:\Developer\D\dm\bin":"C:\Developer\D\dmd2\windows\bin":$PATH
$ cd ~
$ unzip wxWidgets-2.8.12.zip
$ cd wxWidgets-2.8.12/include/wx
$ cp setup_inc.h setup.h
$ export 
WXDIR="C:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12"

$ cd ~
$ git clone https://github.com/afb/wxd.git
$ cd wxD
$ make

cd wxc
make
dmc -D__DMD__ -mn -g -o+none -D____ -D__WXDEBUG__  
-IC:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\include  -IC:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\lib\dmc_lib\mswd -w- -I. -WA -DNOPCH -HP90 -Ar -Ae   -HP99 -c -owx-release.obj wx-release.cpp
Error 
C:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\include\wx/chkconf.h 1817:  "wxClipboard requires wxDataObject"
--- errorlevel 1

the file to be compiled wx-release.cpp has the following lines:

#include <stdio.h>
#include "wx/defs.h"

#if defined(__APPLE__) && !(wxCHECK_VERSION(2,6,1)) // will be 
2.6.4 eventually
     /* don't support the broken 2.5.3, in Mac OS X 10.4 */
     #error "unsupported wxWidgets version, please upgrade"
#endif

int main(int argc, char *argv[])
{
     if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'v')
         printf("WX_RELEASE_NODOT = ");
     printf("%d%d\n", wxMAJOR_VERSION, wxMINOR_VERSION);
     return 0;
}


When I look at chkconf.h 1817:

#if wxUSE_CLIPBOARD && !wxUSE_DATAOBJ
#   ifdef wxABORT_ON_CONFIG_ERROR
#       error "wxClipboard requires wxDataObject"
#   else
#       undef wxUSE_DATAOBJ
#       define wxUSE_DATAOBJ 1
#   endif
#endif /* wxUSE_CLIPBOARD */

BUT inside the setup.h I am sure that wxUSE_CLIPBOARD and 
wxUSE_DATAOBJ are true...

When we look at source code we can see that wx/defs.h is included 
and it's this file that includes wx/setup.h but the compiler 
doesn't seem to see it...

But I have also found something weird, if I put some garbage text 
just before include <stdio.h> the compiler is not happy:

$ make
cd wxc
make
dmc -D__DMD__ -mn -g -o+none -D____ -D__WXDEBUG__  
-IC:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\include  -IC:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\lib\dmc_lib\mswd -w- -I. -WA -DNOPCH -HP90 -Ar -Ae   -HP99 -c -owx-release.obj wx-release.cpp
extern "C" {
      ^
C:\Developer\D\dm\bin\..\include\stdio.h(10) : Error: missing 
decl-specifier-seq for declaration of 'ss'
size_t  __CLIB fread(void *,size_t,size_t,FILE *);


but if I put the same letters just after <stdio.h>, compiler 
doesn't give an error about unrecognized tokens !!!

#include <stdio.h>
ss

$ make
cd wxc
make
dmc -D__DMD__ -mn -g -o+none -D____ -D__WXDEBUG__  
-IC:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\include  -IC:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\lib\dmc_lib\mswd -w- -I. -WA -DNOPCH -HP90 -Ar -Ae   -HP99 -c -owx-release.obj wx-release.cpp
Error 
C:\Developer\cygwin64\home\Vincent\projects\dlang\wxWidgets-2.8.12\include\wx/chkconf.h 1817:  "wxClipboard requires wxDataObject"
--- errorlevel 1





More information about the Digitalmars-d mailing list