Which is the active fork in DFL gui library ?

Mike Parker aldacron at gmail.com
Sun Nov 3 07:06:12 UTC 2019


On Saturday, 2 November 2019 at 20:01:27 UTC, Vinod K Chandran 
wrote:
> Hi all,
> I just found that DFL gui library very interesting. But after 
> some searching, i can see that DFL is inactive and there is few 
> other forks for it. So this is my question - Which fork is good 
> for a gui development in windows platform.

DFL is a long, long dead library. It was created with D1. I'm 
unaware of any active fork.


> BTW, i just tested the gtkD and successfully compiled a hello 
> app. How do i avoid the console window when compiling gtkD app ?
> Thanks in advance.

Any Windows executable compiled with a main function is by 
default considered a "console subsystem" application. You can 
specify to the linker that it should be a "windows subsystem" 
application (for which a console window will not be created) with 
a linker command line switch.

Assuming you're using DMD, when you're using the OPTLINK linker 
(which is the default when invoking DMD directly or when passing 
-m32, or the DUB switch -ax86), the switch is /SUBSYSTEM:WINDOWS. 
You can pass it on the DMD command line with -L, as in:

-L/SUBSYSTEM:WINDOWS

With the Microsoft linker (-m32mscoff or -m64 on the dmd command 
line, -ax86mscoff or -x86_64 with dub, or the default with recent 
64-bit dub versions), it's the same switch. But you also need to 
specify the entry point as being main and not WinMain, so:

-L/SUBSYSTEM:WINDOWS -L/ENTRY:mainCRTStartup

When using dub, you can put the appropriate flags in a "dflags" 
entry in your dub.json or dub.sdl.

Here's an example, winhello.d, that should work with all of the 
following command lines:

dub -ax86 --single winhello.d
dub -ax86_mscoff --single winhello.d
dub -ax86_64 --single winhello.d

dmd -L/SUBSYSTEM:WINDOWS winhello.d
dmd -L/SUBSYSTEM:WINDOWS -L/ENTRY:mainCRTstartup -m32mscoff 
winhello.d
dmd -L/SUBSYSTEM:WINDOWS -L/ENTRY:mainCRTstartup -m64 winhello.d

If you don't have the Microsoft build tools installed, -m32mscoff 
and -m64 will use the lld linker that ships with DMD (if you 
chose to install it when you installed dmd). In that case, I'm 
not sure if the switches are the same. I've never used it and 
don't have it installed.


More information about the Digitalmars-d-learn mailing list