www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - can't complie throw new Exception();

reply NCODA <jastoms gmail.com> writes:
Hi, I'm new to D and trying to learn how to use it

I downloaded some sample code and get this compile error
  Symbol Undefined _D6object9Exception5_ctorMFAaZC9Exception


Its on the throw new Exception line (If I comment it out, I can compile
properly)
	// Now open a SDL OpenGL window with the given parameters
	if (SDL_SetVideoMode(width, height, bits, mode) is null)
	{
		throw new Exception("Failed to open OpenGL window: " ~ getSDLError());
	}


Anyone know what could cause this? And how to fix it?
The sample game runs fine if I comment out all the exceptions, but I would like
to have Exception handling.

Im using derelict and tango with DMD
(CodeBlocks IDE)
Nov 10 2007
next sibling parent BCS <ao pathlink.com> writes:
Reply to NCODA,

 Hi, I'm new to D and trying to learn how to use it
 
 I downloaded some sample code and get this compile error
 Symbol Undefined _D6object9Exception5_ctorMFAaZC9Exception
 Its on the throw new Exception line (If I comment it out, I can
 compile properly)
 // Now open a SDL OpenGL window with the given parameters
 if (SDL_SetVideoMode(width, height, bits, mode) is null)
 {
 throw new Exception("Failed to open OpenGL window: " ~
 getSDLError());
 }
 Anyone know what could cause this? And how to fix it?
 
 The sample game runs fine if I comment out all the exceptions, but I
 would like to have Exception handling.
 
 Im using derelict and tango with DMD
 (CodeBlocks IDE)
My guess would be some lib path error, but it's only a guess.
Nov 10 2007
prev sibling parent Anders Johnsen <skabet gmail.com> writes:
NCODA wrote:

 Hi, I'm new to D and trying to learn how to use it
 
 I downloaded some sample code and get this compile error
   Symbol Undefined _D6object9Exception5_ctorMFAaZC9Exception
 
 
 Its on the throw new Exception line (If I comment it out, I can compile
 properly) // Now open a SDL OpenGL window with the given parameters
 if (SDL_SetVideoMode(width, height, bits, mode) is null)
 {
 throw new Exception("Failed to open OpenGL window: " ~ getSDLError());
 }
 
 
 Anyone know what could cause this? And how to fix it?
 The sample game runs fine if I comment out all the exceptions, but I would
 like to have Exception handling.
 
 Im using derelict and tango with DMD
 (CodeBlocks IDE)
Looks like the error i had when i installed tango, but forgot to copy over tango's object.d file to the include root(overwrite the old phobos object.d) Anders Johnsen
Nov 11 2007