"Error 42: Symbol Undefined" for asserts

Andre Steenveld via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 2 04:53:34 PDT 2014


Hello all,

I just started learning D and I thought it would be a good idea 
to port the Reactive Extensions to D. So far so good, I have been 
using Xamarin Studio in combination with Mono-D on Windows 7 and 
DMD 2.065.0.

Even though unit testing is baked in to the language I wanted to 
set up a separate unit test project. Mainly because I am building 
a library and I also want to test linking to it from a 
executable. The test project is a console application which is 
always build with the -unittest flag. The entire project can be 
found at https://github.com/AndreSteenveld/RDX

Building the library itself seems to work but linking to it 
breaks for some reason what I am getting from the linker is this:

"""
C:\Program Files\D\2.065.0\dmd2\windows\bin\dmd.exe -unittest 
-debug -gc "test\main.d" "test\observer.d"  "-IC:\Program 
Files\D\2.065.0\dmd2\src\druntime\import" "-IC:\Program 
Files\D\2.065.0\dmd2\src\phobos" 
"-IC:\Users\Andre\Documents\RDX\RDX" "-odobj\Unittest" 
"-ofC:\Users\Andre\Documents\RDX\Test\bin\Unittest\Test.exe"


OPTLINK (R) for Win32  Release 8.00.15
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
obj\Unittest\Test.obj(Test)
  Error 42: Symbol Undefined _D3rdx12Notification8__assertFiZv
obj\Unittest\Test.obj(Test)
  Error 42: Symbol Undefined _D3rdx8Observer8__assertFiZv
obj\Unittest\Test.obj(Test)
  Error 42: Symbol Undefined _D3rdx17AnonymousObserver8__assertFiZv
obj\Unittest\Test.obj(Test)
  Error 42: Symbol Undefined 
_D3rdx9utilities7throwerFZDFNaNfC6object9ThrowableZv
obj\Unittest\Test.obj(Test)
  Error 42: Symbol Undefined _D3rdx9utilities8nop_voidFZDFNaNbNfZv
obj\Unittest\Test.obj(Test)
  Error 42: Symbol Undefined _D3rdx8Observer12__ModuleInfoZ
obj\Unittest\Test.obj(Test)
  Error 42: Symbol Undefined _D3rdx12Notification12__ModuleInfoZ
--- errorlevel 7
"""

I am using code contracts and I thought they were a part of the 
language, and otherwise that it would be included by building 
against Phobos and the DRuntime. My questions basically is; What 
is the linker trying to tell me? And what are the possible 
solutions?

Cheers,
Andre




More information about the Digitalmars-d-learn mailing list