nomad-software / tkd

GUI toolkit for the D programming language based on Tcl/Tk
MIT License
117 stars 16 forks source link

Can't compile under Windows #10

Closed gecko0307 closed 10 years ago

gecko0307 commented 10 years ago

tkd\dialog\dialog.d(22): Error: class tkd.dialog.dialog.Dialog unable to resolve forward reference in definition

The same is for DirectoryDialog, FontDialog, FileDialog, OpenFileDialog, SaveFileDialog, MessageDialog. I'm building with DMD 2.064.2.

nomad-software commented 10 years ago

Try updating DMD and Dub.

gecko0307 commented 10 years ago

Tried with 2.065, same thing.

gecko0307 commented 10 years ago

Honestly, I don't use DUB, but my own build tool instead (kinda got used to it). DUB, AFAIK, compiles everything with one compiler call, but I like incremental building, so my tool compiles all modules one by one, caching object files and updating dependency graph when needed. Could the issue be somehow related to this? Is it necessary to build tkd with one DMD call due to some internal code specifics?

nomad-software commented 10 years ago

There shouldn't be anything special needed to compile everything, personally i use the following command while testing to compile the example:

!rdmd --force -de -debug=log -debug=showTclErrors -J./media -w -I.. -I/media/Data/Projects/D/x11/source -I/media/Data/Projects/D/tcltk/source -L-ltcl -L-ltk example.d

To compile the example using dub, just use:

dub --config=example

I've just fixed a bug in tcltk and tkd so pull the latest tkd and try compiling again. But i think the issue is probably related to your build process.

gecko0307 commented 10 years ago

Strange. If I entirely remove those dialogs, everything compiles and runs fine.

nomad-software commented 10 years ago

It looks like it was a circular reference issue with tkdapplication importing dialog which which was importing tkdapplication to get hold of the window class. I've broken these files up to remove this circular dependency issue which should be more kind to your build process. See https://github.com/nomad-software/tkd/releases/tag/v1.0.2-beta