Thread overview
Unexpected OPTLINK Termination
Apr 07, 2005
mike
Apr 08, 2005
Walter
Apr 11, 2005
Mike
April 07, 2005
I'm a D newbie playing with this promising language.

During the link phase of my application I'm getting a dialog box titled "Unexpected OPTLINK Termination at EIP=...", the dialog contains a dump of registers and "First=00430000".

I'm linking using the following command-line (link.exe is the Digital-Mars linker):
link.exe MainForm+GnuDip,GnuDip,,phobos.lib+dfl.lib+WS2_32.LIB+user32+kernel32/RC:tray.res/noi;

dfl - version 0.8
DMD - version 0.120 (same for 0.119).

Do you have a clue as to what am I doing wrong? Library version mismatch?

Thanks,
Mike.
April 08, 2005
I have no idea what is going wrong. Can you try and reduce it down?


April 11, 2005
Walter wrote:
> I have no idea what is going wrong. Can you try and reduce it down?
> 
> 

I reduced it to the following: using the example that appears in http://www.dprogramming.com/dfl.php - the "classic Hello, world", and adding 2 lines (my lines are marked with comments before them):

//first change
import std.stream;
import dfl.all;

int main()
{
	Form myForm;
	Label myLabel;
	
//second change, this line is the one causing the linker error dialog-box
	File conf = new File("junk.txt", FileMode.In | FileMode.Out);
	myForm = new Form;
	myForm.text = "DFL Example";
	
	myLabel = new Label;
	myLabel.text = "Hello, World";
	myLabel.size = Size(100, 14);
	myLabel.parent = myForm;
	
	Application.run(myForm);
	
	return 0;
}

If the File ctor line is commented-out, it compiles & runs.
As I mentioned, I'm using D version 0.120, DFL version 0.8.

The following line is used to compile the file:
dmd MainForm.d phobos.lib dfl.lib

Some further trimming brought it down to:

import std.stream;
import dfl.all;
int main()
{
	Form myForm = new Form;
	File conf = new File;
	return 0;
}

which doesn't work, versus:

import std.stream;
import dfl.all;
int main()
{
	Form myForm;
	File conf = new File;
	return 0;
}

which does.

What am I doing wrong?

Thanks,
Mike.