Jump to page: 1 2
Thread overview
GtkD - how to install
Dec 22, 2013
Amateur
Dec 22, 2013
John Colvin
Dec 22, 2013
Amateur
Dec 22, 2013
Benjamin Thaut
Dec 22, 2013
Mike Parker
Dec 22, 2013
Mike Wey
Dec 22, 2013
Russel Winder
Dec 23, 2013
DLang Beginner
Dec 23, 2013
Alexandr Druzhinin
Dec 23, 2013
DLang Beginner
Dec 23, 2013
Alexandr Druzhinin
Dec 23, 2013
DLang Beginner
Dec 23, 2013
Alexandr Druzhinin
Dec 23, 2013
DLang Beginner
Dec 23, 2013
Alexandr Druzhinin
Dec 22, 2013
Jordi Sayol
December 22, 2013
Hello,

I'm beginning with programming on desktop. After choosing which
language is "da best" for me, I chose D. And now I want to create
GUI applications, so I tried installing GtkD and I failed. Can
anybody give me a short manual?

I'd like to code on linux (openSUSE 13.1), but if I'll get help
on Windows, I'll be happy too.

Thank you
December 22, 2013
On Sunday, 22 December 2013 at 13:29:04 UTC, Amateur wrote:
> Hello,
>
> I'm beginning with programming on desktop. After choosing which
> language is "da best" for me, I chose D. And now I want to create
> GUI applications, so I tried installing GtkD and I failed. Can
> anybody give me a short manual?
>
> I'd like to code on linux (openSUSE 13.1), but if I'll get help
> on Windows, I'll be happy too.
>
> Thank you

I would recommend using dub. Either download a release from http://code.dlang.org/download or clone the github repo https://github.com/rejectedsoftware/dub and build with build.sh

then you can list gtkd as a dependency for your project and dub will sort it out for you (hopefully).


You will need to install the latest gtk+ libs first with yast or zipper or whatever you use for package management.
December 22, 2013
On Sunday, 22 December 2013 at 13:38:25 UTC, John Colvin wrote:
> On Sunday, 22 December 2013 at 13:29:04 UTC, Amateur wrote:
>> Hello,
>>
>> I'm beginning with programming on desktop. After choosing which
>> language is "da best" for me, I chose D. And now I want to create
>> GUI applications, so I tried installing GtkD and I failed. Can
>> anybody give me a short manual?
>>
>> I'd like to code on linux (openSUSE 13.1), but if I'll get help
>> on Windows, I'll be happy too.
>>
>> Thank you
>
> I would recommend using dub. Either download a release from http://code.dlang.org/download or clone the github repo https://github.com/rejectedsoftware/dub and build with build.sh
>
> then you can list gtkd as a dependency for your project and dub will sort it out for you (hopefully).
>
>
> You will need to install the latest gtk+ libs first with yast or zipper or whatever you use for package management.

Yeah, I installed dub and ran commands "dub init main" and "dub fetch --local gtk-d". It worked properly, but how to continue? I tried compile simple app which contains only "import gtk.MainWindow;" and compiler yells that source for this cannot be found.

What have I to do next?
I have installed Gtk+ libraries, dmd, dub and I ran too commands "dub init main" and "dub fetch --local gtk-d".
December 22, 2013
Am 22.12.2013 15:15, schrieb Amateur:
> Yeah, I installed dub and ran commands "dub init main" and "dub fetch
> --local gtk-d". It worked properly, but how to continue? I tried compile
> simple app which contains only "import gtk.MainWindow;" and compiler
> yells that source for this cannot be found.
>
> What have I to do next?
> I have installed Gtk+ libraries, dmd, dub and I ran too commands "dub
> init main" and "dub fetch --local gtk-d".

You have to create a package.json file for you project and add gtk as a dependency.

See this page for further details: http://code.dlang.org/package-format

When you are done setting up the package.json call "dub init" and everything should be setup correctly.
December 22, 2013
On 12/22/2013 11:15 PM, Amateur wrote:

>
> What have I to do next?
> I have installed Gtk+ libraries, dmd, dub and I ran too commands "dub
> init main" and "dub fetch --local gtk-d".

You need to add gtkd as a dependency to your project's package.json:

{	
	"dependencies": {
		"gtk-d": "~master"
	}
}

Also, when using dub to manage your project, you don't need to 'fetch'. As long as a library is listed as a dependency, dub will fetch it automatically.
December 22, 2013
On Sun, 2013-12-22 at 13:29 +0000, Amateur wrote:
> Hello,
> 
> I'm beginning with programming on desktop. After choosing which language is "da best" for me, I chose D. And now I want to create GUI applications, so I tried installing GtkD and I failed. Can anybody give me a short manual?

I cloned the Git repository for GtkD and then set up a bash script to give the GtkD make system all the right parameters so I could compile it for DMD, GDC and LDC2. However this is not trivial unless you are familiar with Make.

However I also just tried using Dub and it works very nicely. I think the general opinion will these days be to use Dub.

> I'd like to code on linux (openSUSE 13.1), but if I'll get help
> on Windows, I'll be happy too.

I only have Debian and Fedora Linux and OS X, I don't do Windows ;-)

-- 
Russel. ============================================================================= Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder@ekiga.net 41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@winder.org.uk London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder


December 22, 2013
On 12/22/2013 03:41 PM, Mike Parker wrote:
> On 12/22/2013 11:15 PM, Amateur wrote:
>
>>
>> What have I to do next?
>> I have installed Gtk+ libraries, dmd, dub and I ran too commands "dub
>> init main" and "dub fetch --local gtk-d".
>
> You need to add gtkd as a dependency to your project's package.json:
>
> {
>      "dependencies": {
>          "gtk-d": "~master"
>      }
> }
>
> Also, when using dub to manage your project, you don't need to 'fetch'.
> As long as a library is listed as a dependency, dub will fetch it
> automatically.

I would recommend listing the subpackage as a dependency:

{
        "dependencies": {
            "gtk-d:gtkd": "~master"
        }
}

-- 
Mike Wey
December 22, 2013
El 22/12/13 14:29, Amateur ha escrit:
> Hello,
> 
> I'm beginning with programming on desktop. After choosing which language is "da best" for me, I chose D. And now I want to create GUI applications, so I tried installing GtkD and I failed. Can anybody give me a short manual?
> 
> I'd like to code on linux (openSUSE 13.1), but if I'll get help
> on Windows, I'll be happy too.
> 
> Thank you
> 

There is <http://d-apt.sourceforge.net/> for Debian Linux.

-- 
Jordi Sayol
December 23, 2013
On Sunday, 22 December 2013 at 14:52:23 UTC, Russel Winder wrote:
> On Sun, 2013-12-22 at 13:29 +0000, Amateur wrote:
>> Hello,
>> 
>> I'm beginning with programming on desktop. After choosing which
>> language is "da best" for me, I chose D. And now I want to create
>> GUI applications, so I tried installing GtkD and I failed. Can
>> anybody give me a short manual?
>
> I cloned the Git repository for GtkD and then set up a bash script to
> give the GtkD make system all the right parameters so I could compile it
> for DMD, GDC and LDC2. However this is not trivial unless you are
> familiar with Make.
>
> However I also just tried using Dub and it works very nicely. I think
> the general opinion will these days be to use Dub.
>
>> I'd like to code on linux (openSUSE 13.1), but if I'll get help
>> on Windows, I'll be happy too.
>
> I only have Debian and Fedora Linux and OS X, I don't do Windows ;-)

Hello again. I have successfully installed dub and made GtkD dependency. But...

I tried to compile this code:

import gtk.MainWindow;
import gtk.Label;
import gtk.Main;

void main(string[] args)
{
    Main.init(args);
    MainWindow win = new MainWindow("Hello World");
    win.setDefaultSize(200, 100);
    win.add(new Label("Hello World"));
    win.showAll();
    Main.run();
}

But compiler said that he won't compile this, because "app.d(1): Error: module MainWindow is in file 'gtk/MainWindow.d' which cannot be read". Etc. for other imports.

So I copied libraries in /source directory and now compiler knows, from where can he import, but compiler is yelling another errors.

app.o:(.data+0x10): undefined reference to `_D3gtk10MainWindow12__ModuleInfoZ'
app.o:(.data+0x18): undefined reference to `_D3gtk5Label12__ModuleInfoZ'
app.o:(.data+0x20): undefined reference to `_D3gtk4Main12__ModuleInfoZ'
app.o: In function `_Dmain':
app.d:(.text._Dmain+0x15): undefined reference to `_D3gtk4Main4Main4initFKAAyaZv'
app.d:(.text._Dmain+0x1b): undefined reference to `_D3gtk10MainWindow10MainWindow7__ClassZ'
app.d:(.text._Dmain+0x3a): undefined reference to `_D3gtk10MainWindow10MainWindow6__ctorMFAyaZC3gtk10MainWindow10MainWindow'
app.d:(.text._Dmain+0x5b): undefined reference to `_D3gtk5Label5Label7__ClassZ'
app.d:(.text._Dmain+0x85): undefined reference to `_D3gtk5Label5Label6__ctorMFAyabZC3gtk5Label5Label'
app.d:(.text._Dmain+0xa9): undefined reference to `_D3gtk4Main4Main3runFZv'
collect2: error: ld returned 1 exit status
--- errorlevel 1
December 23, 2013
Show your package.json file and the project structure.
« First   ‹ Prev
1 2