dwt compile problem

Jesse Phillips jessekphillips at gmail.com
Mon Feb 4 17:40:26 PST 2008


On Mon, 04 Feb 2008 19:14:08 -0500, Ty Tower wrote:

> Can anyone tell me what the linker is not finding here? It seems to make
> the object OK but cant link
> 
> [tytower at localhost misc]$ dmd ./hello.d gcc hello.o -o hello -m32
> -Xlinker -L/dmd/bin/../lib -lphobos -lpthread -lm hello.o:(.data+0xac):
> undefined reference to `_D3dwt3all12__ModuleInfoZ' hello.o: In function
> 
`_D5hello5Hello4openMFC3dwt7widgets7display7DisplayZC3dwt7widgets5shell5Shell':
> ./hello.d:
(.gnu.linkonce.t_D5hello5Hello4openMFC3dwt7widgets7display7DisplayZC3dwt7widgets5shell5Shell
+0x11):
> undefined reference to `_D3dwt7widgets5shell5Shell7__ClassZ'
> ./hello.d:
(.gnu.linkonce.t_D5hello5Hello4openMFC3dwt7widgets7display7DisplayZC3dwt7widgets5shell5Shell
+0x1f):
> undefined reference to
> 
`_D3dwt7widgets5shell5Shell5_ctorMFC3dwt7widgets7display7DisplayZC3dwt7widgets5shell5Shell'
> hello.o: In function `_D5hello5Hello3runFZv':
> ./hello.d:(.gnu.linkonce.t_D5hello5Hello3runFZv+0x8): undefined
> reference to
> 
`_D3dwt7widgets7display7Display10getDefaultFZC3dwt7widgets7display7Display'
> hello.o: In function `_Dmain':
> ./hello.d:(.gnu.linkonce.t_Dmain+0x26): undefined reference to
> 
`_D3dwt7widgets10messagebox10MessageBox11showMessageFAaAaC3dwt7widgets5shell5ShelliZi'
> collect2: ld returned 1 exit status
> --- errorlevel 1

If your trying to compile a dwt project from the now dwt ports, you will 
have to install Tango first. As for the compiling command, there are a 
lot of libraries to reference. I use dsss for building and for a simple 
program this is the command it generates for rebuild:

/usr/local/bin/rebuild -Idsss_imports/ -I. -S./ -I/home/he/d/include/d 
-S/home/he/d/lib/  -I/usr/local/include/d -S/usr/local/lib -I/home/he/d/
include/d -S/home/he/d/lib  -oqdsss_objs/D -L-lgtk-x11-2.0 -L-lgdk-
x11-2.0 -L-latk-1.0 -L-lgdk_pixbuf-2.0 -L-lgthread-2.0 -L-lm -L-
lpangocairo-1.0 -L-lfontconfig -L-lXtst -L-lXext -L-lXrender -L-lXinerama 
-L-lXi -L-lXrandr -L-lXcursor -L-lXcomposite -L-lXdamage -L-lX11 -L-
lXfixes -L-lpango-1.0 -L-lgobject-2.0 -L-lgmodule-2.0 -L-ldl -L-lglib-2.0 
-L-lcairo -g -gc DrawingBoard.d -ofDrawingBoard 

So my suggestion would be to install dsss for building the projects. If 
you do you can switch the default in the rebuild configuration directory 
to dmd-posix-tango And the -dc= flag might let you change it on compile.


More information about the Digitalmars-d-learn mailing list