digitalmars.empire - D version fails to compile
- Derek Parnell (18/18) Mar 16 2005 I just downloaded the D version and used DMD v0.118 to compile it. I get...
- Walter (4/14) Mar 16 2005 Just cast it to the right value. I uploaded a new set of sources that
- Derek Parnell (39/61) Mar 16 2005 Well that was about as useful as tits of a bull! Of course one has to fi...
- Walter (9/50) Mar 17 2005 Sorry about that.
- Stewart Gordon (10/13) Mar 18 2005 I've just downloaded the source, and can't find any of the numerous bug
- Walter (5/14) Mar 18 2005 I didn't look at them yet as I hadn't seen a reply yet on the copyright
- Stewart Gordon (7/26) Mar 21 2005 Rest assured the changes are free for you to do whatever you want -
- Walter (3/5) Mar 23 2005 Thanks!
I just downloaded the D version and used DMD v0.118 to compile it. I get a lot of errors. And if I use the -w switch there are masses of warnings - some I note are hiding potential bugs too. The one error that has stopped me is ... function std.c.windows.windows.DialogBoxParamA (HANDLE,char*,HANDLE,int(Windows *)(HANDLE,uint,uint,int),int) does not match argument types (HANDLE,char[7],HANDLE,int(Windows *)(),int) The source line in question reads .... DialogBoxParamA(global.hinst, "InitBox", hwnd, global.lpfnInitDlgProc, 0); and 'lpfnInitDlgProc' is defined as ... FARPROC lpfnInitDlgProc ; and in std.c.windows.d we find ... alias int (*FARPROC)(); Any clues? -- Derek Melbourne, Australia 17/03/2005 11:43:24 AM
Mar 16 2005
"Derek Parnell" <derek psych.ward> wrote in message news:1m0cgyfsaq60e$.70nc0ei00gbc$.dlg 40tude.net...function std.c.windows.windows.DialogBoxParamA (HANDLE,char*,HANDLE,int(Windows *)(HANDLE,uint,uint,int),int) does not match argument types (HANDLE,char[7],HANDLE,int(Windows *)(),int) The source line in question reads .... DialogBoxParamA(global.hinst, "InitBox", hwnd, global.lpfnInitDlgProc, 0); and 'lpfnInitDlgProc' is defined as ... FARPROC lpfnInitDlgProc ; and in std.c.windows.d we find ... alias int (*FARPROC)(); Any clues?Just cast it to the right value. I uploaded a new set of sources that compiles.
Mar 16 2005
On Wed, 16 Mar 2005 20:08:09 -0800, Walter wrote:"Derek Parnell" <derek psych.ward> wrote in message news:1m0cgyfsaq60e$.70nc0ei00gbc$.dlg 40tude.net...Well that was about as useful as tits of a bull! Of course one has to fix it to have the 'right' value. But it isn't clear to all and sundry what that actually would entail. I can see that what you have done is added ... extern (Windows) { alias int function(HANDLE, uint, uint, int) DLGPROC; } and changed ... FARPROC lpfnInitDlgProc ; to ... DLGPROC lpfnInitDlgProc ; Just in case you hadn't guessed, that was not an obvious solution to me. I take it that the two lines below are equivalent. alias int function(HANDLE, uint, uint, int) DLGPROC; alias int (*DLGPROC)(HANDLE, uint, uint, int); I'm guessing the first is the D style and the second is the old C style. I prefer the D style - it is much more clearer to read and understand. I would have twigged if the original alias had have been coded as ... alias int function() FARPROC; Anyhow, I made this addition below to empire.d and ran the latest (not released yet) version of build and it built it without fuss - no makefile required. version(build) { pragma(link, "winmm.lib"); pragma(link, "comdlg32.lib"); pragma(target, "winemp.exe"); pragma(build, "empire.rc"); pragma(main, "winmain.d"); } then used ... build empire By the way, empire.rc refers to cursor.bmp and empire.ico which are not in the distro. -- Derek Melbourne, Australia 17/03/2005 5:47:27 PMfunction std.c.windows.windows.DialogBoxParamA (HANDLE,char*,HANDLE,int(Windows *)(HANDLE,uint,uint,int),int) does not match argument types (HANDLE,char[7],HANDLE,int(Windows *)(),int) The source line in question reads .... DialogBoxParamA(global.hinst, "InitBox", hwnd, global.lpfnInitDlgProc, 0); and 'lpfnInitDlgProc' is defined as ... FARPROC lpfnInitDlgProc ; and in std.c.windows.d we find ... alias int (*FARPROC)(); Any clues?Just cast it to the right value. I uploaded a new set of sources that compiles.
Mar 16 2005
"Derek Parnell" <derek psych.ward> wrote in message news:1wre2w8kjo9s3.15hsamftw8lmi.dlg 40tude.net...On Wed, 16 Mar 2005 20:08:09 -0800, Walter wrote:Sorry about that."Derek Parnell" <derek psych.ward> wrote in messageWell that was about as useful as tits of a bull! Of course one has to fix it to have the 'right' value. But it isn't clear to all and sundry what that actually would entail.Any clues?Just cast it to the right value. I uploaded a new set of sources that compiles.I can see that what you have done is added ... extern (Windows) { alias int function(HANDLE, uint, uint, int) DLGPROC; } and changed ... FARPROC lpfnInitDlgProc ; to ... DLGPROC lpfnInitDlgProc ; Just in case you hadn't guessed, that was not an obvious solution to me.A cast would have worked too, in the same manner that C tends to rely on typedef's to cast function pointer types, but I thought changing FARPROC to DLGPROC looked a bit nicer.I take it that the two lines below are equivalent. alias int function(HANDLE, uint, uint, int) DLGPROC; alias int (*DLGPROC)(HANDLE, uint, uint, int); I'm guessing the first is the D style and the second is the old C style.That's right, though D will accept the C style.I prefer the D style - it is much more clearer to read and understand.So do I.I would have twigged if the original alias had have been coded as ... alias int function() FARPROC; Anyhow, I made this addition below to empire.d and ran the latest (not released yet) version of build and it built it without fuss - no makefile required. version(build) { pragma(link, "winmm.lib"); pragma(link, "comdlg32.lib"); pragma(target, "winemp.exe"); pragma(build, "empire.rc"); pragma(main, "winmain.d"); } then used ... build empire By the way, empire.rc refers to cursor.bmp and empire.ico which are not in the distro.Thanks. It's fixed now.
Mar 17 2005
Walter wrote: <snip>Just cast it to the right value. I uploaded a new set of sources that compiles.I've just downloaded the source, and can't find any of the numerous bug fixes I sent you a while ago. Did you lose my fixed version, or did I mistake your questionCool! And just to reiterate, these changes are donated?for being rhetorical? Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Mar 18 2005
"Stewart Gordon" <smjg_1998 yahoo.com> wrote in message news:d1eil5$qec$1 digitaldaemon.com...Walter wrote: <snip>I didn't look at them yet as I hadn't seen a reply yet on the copyright status of the changes. It's nice to make sure all the t's are crossed and i's are dotted for the copyright issues.Just cast it to the right value. I uploaded a new set of sources that compiles.I've just downloaded the source, and can't find any of the numerous bug fixes I sent you a while ago. Did you lose my fixed version, or did I mistake your question > Cool! And just to reiterate, these changes are donated? for being rhetorical?
Mar 18 2005
Walter wrote:"Stewart Gordon" <smjg_1998 yahoo.com> wrote in message news:d1eil5$qec$1 digitaldaemon.com...Rest assured the changes are free for you to do whatever you want - check in to the official version, claim whatever level of IPR you wish.... Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.Walter wrote: <snip>I didn't look at them yet as I hadn't seen a reply yet on the copyright status of the changes. It's nice to make sure all the t's are crossed and i's are dotted for the copyright issues.Just cast it to the right value. I uploaded a new set of sources that compiles.I've just downloaded the source, and can't find any of the numerous bug fixes I sent you a while ago. Did you lose my fixed version, or did I mistake your questionCool! And just to reiterate, these changes are donated?for being rhetorical?
Mar 21 2005
"Stewart Gordon" <smjg_1998 yahoo.com> wrote in message news:d1manb$2olp$1 digitaldaemon.com...Rest assured the changes are free for you to do whatever you want - check in to the official version, claim whatever level of IPR you wish....Thanks!
Mar 23 2005