www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - GtkD not working

reply "Daemon" <Daemon yahoo.com> writes:
Hello, I'd appreciate any help.

I downloaded the GtkD sources and built the GtkD.lib using rdmd, 
so far so good. I have followed the instructions in "Installing 
on Windows" (editing sc.ini and copying contents of the src 
folder of GtkD into DMD's src folder, etc.). I also installed the 
Gtk 3.8.1 version (x86 and x86-64).

When I tried to compile the simple Hello world type of 
application, I got about 7 "undefined symbols" and it refused to 
compile. So I poked around and added "GtkD.lib" into the Library 
Files section in project settings (I'm using Visual D). Now it 
did compile, but I get an exception in KernelBase.dll.

At this point, I just don't know what to do next. Could someone 
help, please?

Below is the Hello World GtkD-style application that I tried:

module main;

import std.stdio;

import gtk.Main;
import gtk.MainWindow;

void main(string[] args)
{
	Main.init(args);

	MainWindow window = new MainWindow("A Window");

	window.showAll();
	Main.run();	
}
Jun 10 2013
parent reply Mike Wey <mike-wey example.com> writes:
On 06/10/2013 04:51 PM, Daemon wrote:
 Hello, I'd appreciate any help.

 I downloaded the GtkD sources and built the GtkD.lib using rdmd, so far
 so good. I have followed the instructions in "Installing on Windows"
 (editing sc.ini and copying contents of the src folder of GtkD into
 DMD's src folder, etc.). I also installed the Gtk 3.8.1 version (x86 and
 x86-64).

 When I tried to compile the simple Hello world type of application, I
 got about 7 "undefined symbols" and it refused to compile. So I poked
 around and added "GtkD.lib" into the Library Files section in project
 settings (I'm using Visual D). Now it did compile, but I get an
 exception in KernelBase.dll.

 At this point, I just don't know what to do next. Could someone help,
 please?

 Below is the Hello World GtkD-style application that I tried:
Do you get any error messages? -- Mike Wey
Jun 10 2013
parent reply "Daemon" <Daemon yahoo.com> writes:
 Do you get any error messages?
None that I know of. It compiles and starts to launch, then just throws an exception.
Jun 10 2013
parent reply "Daemon" <Daemon yahoo.com> writes:
I've been checking stack overflow and some blogs and kept trying 
various things. I finally managed to launch it normally. For 
anyone who might have had the same problem, the solution is to 
pass "-L-lgtkd -L-ldl" to the command line.

Project -> Properties -> Command Line -> Additional Options.
Jun 11 2013
parent reply Mike Wey <mike-wey example.com> writes:
On 06/11/2013 03:33 PM, Daemon wrote:
 I've been checking stack overflow and some blogs and kept trying various
 things. I finally managed to launch it normally. For anyone who might
 have had the same problem, the solution is to pass "-L-lgtkd -L-ldl" to
 the command line.

 Project -> Properties -> Command Line -> Additional Options.
I don't know your setup but you should usually get some linker error when not linking against the gtkd libraries. Also your first post whould suggest you are using Windows while -L-ldl would link in the Linux dynamic linker. -- Mike Wey
Jun 11 2013
parent "Daemon" <Daemon yahoo.com> writes:
 I don't know your setup but you should usually get some linker 
 error when not linking against the gtkd libraries.

 Also your first post whould suggest you are using Windows while 
 -L-ldl would link in the Linux dynamic linker.
I am using Windows, but adding those thingamajigs still solves the problem. And I didn't get any errors whatsoever (they should be in the Error List, right?).
Jun 11 2013