-
Notifications
You must be signed in to change notification settings - Fork 74
Installing on Windows
-
Download newest GTK+ runtime installer and GtkD source from gtkd.org
-
Run the Build.d file with rdmd.
rdmd Build.d(Build it with the -m64 flag if you want to build a 64 bits GtkD version.rdmd -m64 Build.d)
Note: Upgrading DMD on Windows results on a "uninstall" of GtkD, being necessary to repeat this steps.
-
Open directory where dmd.exe is installed, for example
C:\D\windows\bin\ -
Open
sc.iniin your editor -
Find
DFLAGSkey under the [Environment] section, and add at end of the line:"-I%@P%\..\..\src\gtkd" -
Copy
GtkDExtractionDir\generated\gtkdtodmddir\src\gtkd -
Copy
gtkd.lib, andgtkdsv.libtodmddir\windows\lib(if you build it with -m64, then put it ondmddir\windows\lib64)
-
Create a new blank file named
hello.d. -
Copy the source code into it.
import gtk.MainWindow; import gtk.Label; import gtk.Main; void main(string[] args) { Main.init(args); MainWindow win = new MainWindow("Hello World"); win.setDefaultSize(200, 100); win.add(new Label("Hello World")); win.showAll(); Main.run(); } -
Compile and link, 32bit:
dmd hello.d -L+gtkd.libor 64bit:
dmd hello.d -Lgtkd.lib -m64 -
If it built successfully, it shouldn't print any output. You can now run
hello.exeto see the program.