www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Generate wxD with dmc/dmd

reply Vincent R <lol dlang.org> writes:
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\
nclude\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






#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\
nclude\wx/chkconf.h 1817:  "wxClipboard requires wxDataObject"
--- errorlevel 1
Nov 07 2015
parent reply Vincent R <lol dlang.org> writes:
On Saturday, 7 November 2015 at 22:12:55 UTC, Vincent R wrote:
 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:

 [...]
Actually I found my problem you can ignore my previous message.
Nov 09 2015
parent Chris <wendlec tcd.ie> writes:
On Monday, 9 November 2015 at 18:03:11 UTC, Vincent R wrote:
 On Saturday, 7 November 2015 at 22:12:55 UTC, Vincent R wrote:
 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:

 [...]
Actually I found my problem you can ignore my previous message.
What was it?
Nov 10 2015