gtkd
Bill Baxter
dnewsgroup at billbaxter.com
Sat Jan 5 15:49:38 PST 2008
llee wrote:
> I'm trying to compile a program to use gtkd, however, I don't know what options I should pass to the d compiler.
>
> I'm using dmd to compile a test program. I'm using one of the example provided on gtkd's dsource website:
>
> import gtk.MainWindow;
> import gtk.Label;
> import gtk.GtkD;
>
> void main(char[][] args)
> {
> GtkD.init(args);
> MainWindow win = new MainWindow("Hello World");
> win.setDefaultSize(200, 100);
> win.add(new Label("Hello World"));
> win.showAll();
>
> GtkD.main();
> }
>
> When I run dmd gtk_example.d, the compiler threw an error stating that it could not find gtk/MainWindow.d.
>
> I did a search for the file and found that dsss had created a gtk directory under /usr/local/include/d/, where /usr/local was the prefix that I used during the build. I copied the program that I'm trying to compile to /usr/local/include/d and tried to recompile it. This time It returned a number of 'undefined reference' errors. For example:
>
> gtk_example.o: (.data+0x30): undefined reference to '_D3gtk10MainWindow12__ModuleInfoZ'
>
> It seems that I need to compile against a library. The instructions provided on gtkd's dsource page say that I need to use gcc to handle linking, and gives the following example:
>
> dmd myprog.d -c
> gcc myprog.o -o myprog -lm -lpthread -ldl -lgtkd -lphobos
>
> It seems that I'm missing the gtkd library. I'm guessing from ld's usage conventions, that the library should be named libgtkd.a. I did a search for this library and the closest thing that appeared was libDD-gtk.a. I tried linking against this and it failed. At the moment I'm out of ideas.
>
> Any help would be appreciated.
>
If you used dsss to download/install gtk then you should probably be
using dsss to compile it:
dsss build myprog
With a simple one-line dsss.conf containing:
[myprog.d]
--bb
More information about the Digitalmars-d
mailing list