View previous topic :: View next topic |
Author |
Message |
mmtrebuchet
Joined: 12 Jun 2011 Posts: 2
|
Posted: Sun Jun 12, 2011 11:34 pm Post subject: How do I get started? |
|
|
Hi, all. I'm on Windows 7 (x64, if it matters.) and I write code in Eclipse, with DDT. I've run the Windows installer for gtkD, and nothing went wrong. But I can't just insert
import gtk.MainWindow;
into my code. I think I need to add the libraries to the build path, but I'm not quite sure what that entails.
Here's the error:
src\helloWorld.d(6): Error: module MainWindow is in file 'gtk\MainWindow.d' which cannot be read
import path[0] = src
import path[1] = C:\D\dmd2\windows\bin\..\..\src\phobos
import path[2] = C:\D\dmd2\windows\bin\..\..\src\druntime\import
I hope this is really easy, I've just never installed a library before. (Coming from Java, where the standard library contains everything.)
Thanks,
Charles |
|
Back to top |
|
|
Mike Wey
Joined: 07 May 2007 Posts: 428
|
Posted: Mon Jun 13, 2011 4:35 am Post subject: |
|
|
The windows installer linked on the main page only installs Gtk itself and not GtkD. To get GtkD get the latest source from svn or download the GtkD-1.4.1.zip file and extract it somewhere.
The build the GtkD libraries, the recommended way to do that on windows is using dsss.
To do so go to the root of the extracted files and run:
dsss build
And then install the libraries using:
dsss install
Now you should be able to build your application using:
dsss build helloworld.d |
|
Back to top |
|
|
mmtrebuchet
Joined: 12 Jun 2011 Posts: 2
|
Posted: Mon Jun 13, 2011 6:58 am Post subject: |
|
|
It works! Huzzah!
Thanks much. =) |
|
Back to top |
|
|
zigapeda
Joined: 14 Jun 2011 Posts: 6
|
Posted: Tue Jun 14, 2011 1:54 am Post subject: |
|
|
Hi,
I'm new to D and try to run gtkD with eclipse DDT too.
I have installed GTK on windows and compiled and installed gtkD.
The demos work fine but I can't get it work with eclipse DDT and the DMD compiler. I've got the same input path error as mmtrebuchet even though I add it to the Interpreter System Librarys.
I hope somone can help
Thanks, zigapeda |
|
Back to top |
|
|
Mike Wey
Joined: 07 May 2007 Posts: 428
|
Posted: Wed Jun 15, 2011 2:53 pm Post subject: |
|
|
If you build the library with dsss, you can either build your application with dsss, or you'll need to modify sc.ini to include the path to the GtkD source and the libraries build by dsss. |
|
Back to top |
|
|
zigapeda
Joined: 14 Jun 2011 Posts: 6
|
Posted: Thu Jun 16, 2011 1:52 am Post subject: |
|
|
I build it with dsss and modify the sc.ini and I build it with dmd too and modify the sc.ini but it wouldn't work. I think I got problems by modify the sc.ini.
I would like to compile with dmd because I can use it within DDT. I modifyed the "Interpreter System Librarys" and add the source from gtkd and I copied the gtkD.lib which I created with DMD into the Lib Folder.
My sc.ini looks like this:
Code: | [Environment]
DFLAGS="-I%@P%\..\dmd2\src\phobos" "-I%@P%\..\dmd2\src\druntime\import" "-I%@P%\..\dmd2\src\gtkD"
LIB="%@P%\..\lib"
LINKCMD=%@P%\link.exe |
(I've checked the paths many times, they should be correct)
I can't compile the clockdemo either, using the command
Code: | dmd main.d clock.d -I..\..\..\src -LC:\devel\lib\gtkD.lib |
or
Code: | dmd main.d clock.d -I..\..\..\src -LC:\devel\lib |
(Paths should be correct too)
Last edited by zigapeda on Fri Jun 17, 2011 12:24 am; edited 1 time in total |
|
Back to top |
|
|
Mike Wey
Joined: 07 May 2007 Posts: 428
|
Posted: Thu Jun 16, 2011 2:15 pm Post subject: |
|
|
I see you added 1 library to the commandline, but dsss doesn't build one library by default but one library for each package in gtkD, gtk, gtkc, cairo, gdk, and more. Did you build the lib some other way?
The bud/build script that is included does build one lib containing everything.
And what are the errors that dmd returns ? |
|
Back to top |
|
|
zigapeda
Joined: 14 Jun 2011 Posts: 6
|
Posted: Fri Jun 17, 2011 12:42 am Post subject: |
|
|
First the error message:
Quote: | bin\dtest.obj(dtest)
Error 42: Symbol Undefined _D3gtk10MainWindow12__ModuleInfoZ |
I compiled gtkD with dsss, copied the libfiles from gtk, gtkc, cairo and so on into the lib folder specified in the sc.ini and add the whole gtkd sourcecode to the "Interpreter System Librarys" which include phobos and druntime too and finaly it wouldn't work.
After that I compiled gtkD with dmd into one gtkD.lib and copied it to the same lib folder and delete the librarys from dsss. |
|
Back to top |
|
|
Mike Wey
Joined: 07 May 2007 Posts: 428
|
Posted: Fri Jun 17, 2011 8:50 am Post subject: |
|
|
Could you post the command line you used to build Gtkd.lib it seems to be missing some symbols. |
|
Back to top |
|
|
zigapeda
Joined: 14 Jun 2011 Posts: 6
|
Posted: Sat Jun 18, 2011 6:58 am Post subject: |
|
|
hmm yeah, I think you're right, I just noticed that my gtkD.lib has only 34KB.
Used this command while I'm in the directory gtkd\src\build. sc.ini includes all other sourcedirectorys like srcsv and srcgda.
|
|
Back to top |
|
|
Mike Wey
Joined: 07 May 2007 Posts: 428
|
Posted: Sat Jun 18, 2011 7:25 am Post subject: |
|
|
Using dmd like that, all the gtkd source files should be passed to the compiler.
If you want a single lib file you could try bud http://www.dsource.org/projects/build
that you can use gtkd\src\build\gtkD.bat to build gtkD. |
|
Back to top |
|
|
zigapeda
Joined: 14 Jun 2011 Posts: 6
|
Posted: Sat Jun 18, 2011 8:13 am Post subject: |
|
|
That worked, now the library have a size of 11,909 KB. But Eclipse respectively the linker throws the same error.
Quote: | Error 42: Symbol Undefined _D3gtk10MainWindow12__ModuleInfoZ
--- errorlevel 1 |
My latest sc.ini looks like that
Code: | LIB="%@P%\..\lib"
DFLAGS="-I%@P%\..\..\src\phobos" "-I%@P%\..\..\src\druntime\import" "-I%@P%\..\..\src\gtkd\src" "-I%@P%\..\..\src\gtkd\srcsv" "-I%@P%\..\..\src\gtkd\srcgda" "-I%@P%\..\..\src\gtkd\srcgl" "-I%@P%\..\..\src\gtkd\srcgstreamer"
LINKCMD=%@P%\link.exe |
GtkD.lib is in the lib folder. |
|
Back to top |
|
|
zigapeda
Joined: 14 Jun 2011 Posts: 6
|
Posted: Sat Jun 18, 2011 10:42 am Post subject: |
|
|
Now I added the GtdD.lib to the DFLAGS and pass it to the linker and it's working.
Thank you very much for your help. |
|
Back to top |
|
|
|