GtkD

Russel Winder russel at winder.org.uk
Sun Aug 11 01:19:06 PDT 2013


On Sat, 2013-08-10 at 23:01 +0200, Mike Wey wrote:
[…]
> The linker probably can't find the GtkD library.

I have tried using dmd and ldc with a -L-L/path/to/library and gdc with
-L/path/to/library but get subtly different error messages. Certainly
all the unfound references are _D... ones so I assume they are D
references.

> On linux if you used "make install" to install the GtkD libraries you 
> could use pkg-config:
> 
> dmd $(pkg-config --cflags --libs gtkd-2) MyApp.d

Well putting the PGK_CONFIG_PATH in so as to find the .pc file, this
give very large numbers of errors. The first three are:
        
        helloWorld_d_gtkd.o:(.data+0xb0): undefined reference to `_D3gtk10MainWindow12__ModuleInfoZ'
        helloWorld_d_gtkd.o:(.data+0xb8): undefined reference to `_D3gtk5Label12__ModuleInfoZ'
        helloWorld_d_gtkd.o:(.data+0xc0): undefined reference to `_D3gtk4Main12__ModuleInfoZ'

from then everything is internal to libgtkd-2.a not having references.
This means though that it has found libgtkd-2.a so. An example:

/home/users/russel/lib.Linux.x86_64/GtkD/lib//libgtkd-2.a(ObjectG.o):(.data+0xb0): undefined reference to `_D4gtkc7gobject12__ModuleInfoZ'

All of them appear to be a lack of ModuleInfoZ as far as I can tell,
which may make this an obvious problem?


Will gdc be able to cope with:

PKG_CONFIG_PATH=$HOME/lib.Linux.x86_64/GtkD/share/pkgconfig pkg-config
--cflags --libs gtkd-2

-I/home/users/russel/lib.Linux.x86_64/GtkD/include/d/gtkd-2/
-L-L/home/users/russel/lib.Linux.x86_64/GtkD/lib/ -L-lgtkd-2 -L-ldl

These look appropriate to DMD and LDC but not GDC, and in a Linux
context GDC is likely the compiler of choice.

Is there an issue of you have to use the same compiler to link code to
libraries as was used to build the libraries in the first place?  This
is not the issue here as I get the same problem for all three compilers,
some else is wrong possibly as well.

> On Windows you will need to list gtkd.lib on the commandline with it's 
> relative or absolute path.

What's Windows?  ;-)


-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130811/17a95aa4/attachment.pgp>


More information about the Digitalmars-d mailing list