www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - RDMD + GTKD2

reply "Sergey" <httpal gmail.com> writes:
    Hello everyone!

*********************
import gtk.MainWindow;
import etc...

class WindowMain{
     ...
     ...
    }
int main(string[] args)
{
	Main.init(args);
	WindowMain main_window = new WindowMain();
	Main.run();
	return 0;
}
**********************

rdmd:
Error: module MainWindow is in file 'gtk/MainWindow.d' which 
cannot be read
import path[0] = .
import path[1] = /usr/include/dmd/phobos
import path[2] = /usr/include/dmd/druntime/import

How to do it?
may be:
pragma(lib, "gtkd2");

I want to get rid of it:
dmd `pkg-config --cflags --libs gtkd2 ` "%f"
Nov 13 2014
parent reply "Gary Willoughby" <dev nomad.so> writes:
On Friday, 14 November 2014 at 07:23:14 UTC, Sergey wrote:
    Hello everyone!

 *********************
 import gtk.MainWindow;
 import etc...

 class WindowMain{
     ...
     ...
    }
 int main(string[] args)
 {
 	Main.init(args);
 	WindowMain main_window = new WindowMain();
 	Main.run();
 	return 0;
 }
 **********************

 rdmd:
 Error: module MainWindow is in file 'gtk/MainWindow.d' which 
 cannot be read
 import path[0] = .
 import path[1] = /usr/include/dmd/phobos
 import path[2] = /usr/include/dmd/druntime/import

 How to do it?
 may be:
 pragma(lib, "gtkd2");

 I want to get rid of it:
 dmd `pkg-config --cflags --libs gtkd2 ` "%f"
You need to specify where the gtkd source is using the -I compiler flag. If you look at the above import paths it's not there.
Nov 14 2014
parent reply "Sergey" <httpal gmail.com> writes:
Thanks, it works (slowly):
rdmd -I"/usr/include/dmd/gtkd2" "file.d"
Nov 16 2014
next sibling parent "Gary Willoughby" <dev nomad.so> writes:
On Monday, 17 November 2014 at 07:16:02 UTC, Sergey wrote:
 Thanks, it works (slowly):
 rdmd -I"/usr/include/dmd/gtkd2" "file.d"
Yeah it takes a while to compile because you are compiling the entire gtkd library each time. You can avoid this by compiling the gtkd library as a static lib and generating *.di files to import as source into your project. This drastically reduces the compile times. :)
Nov 17 2014
prev sibling parent reply "Gary Willoughby" <dev nomad.so> writes:
On Monday, 17 November 2014 at 07:16:02 UTC, Sergey wrote:
 Thanks, it works (slowly):
 rdmd -I"/usr/include/dmd/gtkd2" "file.d"
Here's an old post i wrote with more information. It's a bit dated but will give you some pointers. http://nomad.so/2013/07/cross-platform-gui-programming-using-d-and-gtk/
Nov 17 2014
parent "Sergey" <httpal gmail.com> writes:
On Monday, 17 November 2014 at 14:19:25 UTC, Gary Willoughby 
wrote:
 On Monday, 17 November 2014 at 07:16:02 UTC, Sergey wrote:
 Thanks, it works (slowly):
 rdmd -I"/usr/include/dmd/gtkd2" "file.d"
Here's an old post i wrote with more information. It's a bit dated but will give you some pointers. http://nomad.so/2013/07/cross-platform-gui-programming-using-d-and-gtk/
Thank you, it might be better for me!
Nov 18 2014