Installing on Windows

Mike Wey edited this page Jun 1, 2017 · 23 revisions

Building library

  1. Download newest GTK+ runtime installer and GtkD source from gtkd.org

  2. 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)

Installing library

Note: Upgrading DMD on Windows results on a "unistall" of GtkD, being necesary to repeat this steps.

  1. Open directory where dmd.exe is installed, for example C:\D\windows\bin\

  2. Open sc.ini in your editor

  3. Find DFLAGS key under the [Environment] section, and add at end of the line:

     "-I%@P%\..\..\src\gtkd"
    
  4. Copy GtkDExtractionDir\generated\gtkd to dmddir\src\gtkd

  5. Copy gtkd.lib, and gtkdsv.lib to dmddir\windows\lib (if you build it with -m64, then put it on dmddir\windows\lib64)

Testing Installation

  1. Create a new blank file named hello.d.

  2. 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();
     }
    
  3. Compile and link, 32bit:

     dmd hello.d -L+gtkd.lib
    

    or 64bit:

     dmd hello.d -Lgtkd.lib -m64
    
  4. If it built successfully, it shouldn't print any output. You can now run hello.exe to see the program.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.