www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Unresolved external symbol

reply "Ga" <d d.com> writes:
I have the following code:

import std.stdio;

version(Windows)
{
	extern(Windows)
	{
		nothrow
		{
			alias void *HANDLE;
			alias HANDLE HDC;
			int GetDeviceCaps(HDC, int);
		}
	}
}

int main()
{
	int left = GetDeviceCaps(null, 8);

	readln();

	return 0;
}

And I am getting a "error LNK2019: unresolved external symbol 
GetDeviceCaps referenced in function _Dmain"

Why is that? I'm obviously missing something here, because 
another function, GetDC works properly..
May 01 2014
parent reply "evilrat" <evilrat666 gmail.com> writes:
On Thursday, 1 May 2014 at 22:23:22 UTC, Ga wrote:
 And I am getting a "error LNK2019: unresolved external symbol 
 GetDeviceCaps referenced in function _Dmain"
have you linked gdi32.lib?
May 01 2014
parent "Ga" <d d.com> writes:
On Friday, 2 May 2014 at 06:07:48 UTC, evilrat wrote:
 On Thursday, 1 May 2014 at 22:23:22 UTC, Ga wrote:
 And I am getting a "error LNK2019: unresolved external symbol 
 GetDeviceCaps referenced in function _Dmain"
have you linked gdi32.lib?
Thanks a lot, I wasn't sure what to link with, I must've overlooked it on msdn. Thanks once more
May 02 2014