www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Linker problem

reply "David B. Held" <dheld codelogicconsulting.com> writes:
This is probably just a stupid configuration error, but I just upgraded 
to 2.029 and now I have this problem:

t.d:
void main()
{
     Object o = new Exception("error");
}

dmd t.d
OPTLINK (R) for Win32 Release 8.00.1 Copyright (C) Digital Mars 1989-2004 All rights reserved. t.obj(t) Error 42: Symbol Undefined _D6object9Exception6__ctorMFAyaZC9Exception --- errorlevel 1 I have: \dmd \bin \lib phobos.lib \src and my sc.ini in \dmd\bin looks like so: LIB=\dmd\lib;\dm\lib DFLAGS="-I\dmd\src\phobos" "-I\dmd\src\druntime\import" LINKCMD=% P%\link.exe Obviously, I'm running on Windoze (never had these problems on Linux :( ). Any ideas? Dave
Jul 05 2009
next sibling parent Derek Parnell <derek psych.ward> writes:
On Sun, 05 Jul 2009 18:55:57 -0700, David B. Held wrote:

 I just upgraded 
 to 2.029 and now I have this problem:
I have this too, and I'm using 2.030. It works fine with v1.045. -- Derek Parnell Melbourne, Australia skype: derek.j.parnell
Jul 05 2009
prev sibling next sibling parent reply Walter Bright <newshound1 digitalmars.com> writes:
Check that phobos.lib is really there in \dmd\lib. You could also try 
copying it to your current directory.
Jul 05 2009
parent reply "David B. Held" <dheld codelogicconsulting.com> writes:
Walter Bright wrote:
 Check that phobos.lib is really there in \dmd\lib.
That's the first thing I checked.
 You could also try copying it to your current directory.
That appears to have no effect, even when I put phobos.lib on the build line. Dave
Jul 05 2009
parent Walter Bright <newshound1 digitalmars.com> writes:
David B. Held wrote:
 Walter Bright wrote:
 Check that phobos.lib is really there in \dmd\lib.
That's the first thing I checked.
 You could also try copying it to your current directory.
That appears to have no effect, even when I put phobos.lib on the build line.
Next, grep the phobos.lib for the undefined symbol.
Jul 05 2009
prev sibling next sibling parent reply "Robert Jacques" <sandford jhu.edu> writes:
On Sun, 05 Jul 2009 21:55:57 -0400, David B. Held  
<dheld codelogicconsulting.com> wrote:

 This is probably just a stupid configuration error, but I just upgraded  
 to 2.029 and now I have this problem:

 t.d:
 void main()
 {
      Object o = new Exception("error");
 }

  >dmd t.d
 OPTLINK (R) for Win32  Release 8.00.1
 Copyright (C) Digital Mars 1989-2004  All rights reserved.
 t.obj(t)
   Error 42: Symbol Undefined _D6object9Exception6__ctorMFAyaZC9Exception
 --- errorlevel 1

 I have:

 \dmd
    \bin
    \lib
      phobos.lib
    \src

 and my sc.ini in \dmd\bin looks like so:

 LIB=\dmd\lib;\dm\lib
 DFLAGS="-I\dmd\src\phobos" "-I\dmd\src\druntime\import"
 LINKCMD=% P%\link.exe

 Obviously, I'm running on Windoze (never had these problems on Linux :(  
 ).  Any ideas?

 Dave
The DMD zip switched to using dmd\windows\bin and dmd\windows\lib recently, so if you simply extracted over-top of the old install, that might be your problem. Also, this should probably have been posted on D.learn.
Jul 05 2009
parent "David B. Held" <dheld codelogicconsulting.com> writes:
Robert Jacques wrote:
 [...]
 The DMD zip switched to using dmd\windows\bin and dmd\windows\lib 
 recently, so if you simply extracted over-top of the old install, that 
 might be your problem. Also, this should probably have been posted on 
 D.learn.
I explicitly copied Windows\bin and \lib over \dmd\bin and \lib, so that isn't the problem. Have you used 2.029 and verified that it works correctly? Dave
Jul 05 2009
prev sibling parent reply Jarrett Billingsley <jarrett.billingsley gmail.com> writes:
On Sun, Jul 5, 2009 at 9:55 PM, David B.
Held<dheld codelogicconsulting.com> wrote:
 This is probably just a stupid configuration error, but I just upgraded t=
o
 2.029 and now I have this problem:

 t.d:
 void main()
 {
 =A0 =A0Object o =3D new Exception("error");
 }

dmd t.d
OPTLINK (R) for Win32 =A0Release 8.00.1 Copyright (C) Digital Mars 1989-2004 =A0All rights reserved. t.obj(t) =A0Error 42: Symbol Undefined _D6object9Exception6__ctorMFAyaZC9Exception --- errorlevel 1 I have: \dmd =A0\bin =A0\lib =A0 =A0phobos.lib =A0\src and my sc.ini in \dmd\bin looks like so: LIB=3D\dmd\lib;\dm\lib DFLAGS=3D"-I\dmd\src\phobos" "-I\dmd\src\druntime\import" LINKCMD=3D% P%\link.exe Obviously, I'm running on Windoze (never had these problems on Linux :( )=
.
 =A0Any ideas?

 Dave
If you installed this over top of a previous install, try just unzipping into a clean directory. I remember mysterious linker errors when upgrading DMD2 from pre-2.020 that disappeared when I used a clean install.
Jul 05 2009
parent reply "David B. Held" <dheld codelogicconsulting.com> writes:
Jarrett Billingsley wrote:
 [...]
 If you installed this over top of a previous install, try just
 unzipping into a clean directory.  I remember mysterious linker errors
 when upgrading DMD2 from pre-2.020 that disappeared when I used a
 clean install.
This appears to work, but it's disturbing that the existence of legacy files affects the link. Dave
Jul 05 2009
parent Tim Matthews <tim.matthews7 gmail.com> writes:
David B. Held wrote:
 Jarrett Billingsley wrote:
 [...]
 If you installed this over top of a previous install, try just
 unzipping into a clean directory.  I remember mysterious linker errors
 when upgrading DMD2 from pre-2.020 that disappeared when I used a
 clean install.
This appears to work, but it's disturbing that the existence of legacy files affects the link. Dave
Did you try manually replacing phobos lib file? That code works for my 2.030 so try that instead of 2.029.
Jul 05 2009