FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How do I get started?

 
Post new topic   Reply to topic     Forum Index -> gtkD
View previous topic :: View next topic  
Author Message
mmtrebuchet



Joined: 12 Jun 2011
Posts: 2

PostPosted: Sun Jun 12, 2011 11:34 pm    Post subject: How do I get started? Reply with quote

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
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Mon Jun 13, 2011 4:35 am    Post subject: Reply with quote

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
View user's profile Send private message
mmtrebuchet



Joined: 12 Jun 2011
Posts: 2

PostPosted: Mon Jun 13, 2011 6:58 am    Post subject: Reply with quote

It works! Huzzah!
Thanks much. =)
Back to top
View user's profile Send private message
zigapeda



Joined: 14 Jun 2011
Posts: 6

PostPosted: Tue Jun 14, 2011 1:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Wed Jun 15, 2011 2:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
zigapeda



Joined: 14 Jun 2011
Posts: 6

PostPosted: Thu Jun 16, 2011 1:52 am    Post subject: Reply with quote

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
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Thu Jun 16, 2011 2:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
zigapeda



Joined: 14 Jun 2011
Posts: 6

PostPosted: Fri Jun 17, 2011 12:42 am    Post subject: Reply with quote

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
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Fri Jun 17, 2011 8:50 am    Post subject: Reply with quote

Could you post the command line you used to build Gtkd.lib it seems to be missing some symbols.
Back to top
View user's profile Send private message
zigapeda



Joined: 14 Jun 2011
Posts: 6

PostPosted: Sat Jun 18, 2011 6:58 am    Post subject: Reply with quote

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.
Code:
dmd gtkD.d -c -lib
Back to top
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Sat Jun 18, 2011 7:25 am    Post subject: Reply with quote

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
View user's profile Send private message
zigapeda



Joined: 14 Jun 2011
Posts: 6

PostPosted: Sat Jun 18, 2011 8:13 am    Post subject: Reply with quote

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
View user's profile Send private message
zigapeda



Joined: 14 Jun 2011
Posts: 6

PostPosted: Sat Jun 18, 2011 10:42 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> gtkD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group