February 15, 2014

On 15.02.2014 01:00, Michael wrote:
> I seem to be absolutely useless.
>
> I installed the exe which installs dmd and visualD.
>
> I create a project and try running it as the hello world code is
> still in.
>
> I click build and visual studio crashes.
>
> I am running windows 8.1 x64 and visual studio 2013 professional.
> This issue is on both my laptop and desktop.
>

I have the same setup here. I suspect there is some bad interaction with other installed extensions. Please try the latest beta, it improved cooperation with the NuGet package manager and probably other extensions: https://github.com/D-Programming-Language/visuald/releases
April 07, 2014
Re,

> I am running windows 8.1 x64 and visual Please try the latest beta, it improved cooperation with the NuGet package manager and probably other extensions: https://github.com/D-Programming-Language/visuald/releases

Thank you! It really solves all debug issues.
April 11, 2014
I'm trying to use Visual D with the Windows API bindings (from
here: http://dsource.org/projects/bindings/wiki/WindowsApi), but
I'm getting linking errors for the functions declared in windef.d:

Error	1	Error 42: Symbol Undefined _D5win326windef8MAKELONGFttZk
(uint win32.windef.MAKELONG(ushort,
ushort))	C:\Users\Derek\Documents\Visual Studio
2012\Projects\WindowsApp1\WindowsApp1\	

(One example)

I reckon this means that I need to build a library for this and
probably other files, but I haven't found any instructions to do
so. Furthermore, all of the function in winuser.d link perfectly
fine, so this just confuses me.

So what do I need to do to make this compile and link correctly?
April 11, 2014
On Friday, 11 April 2014 at 02:40:25 UTC, Derek wrote:
> I'm trying to use Visual D with the Windows API bindings (from
> here: http://dsource.org/projects/bindings/wiki/WindowsApi), but
> I'm getting linking errors for the functions declared in windef.d:
>
> Error	1	Error 42: Symbol Undefined _D5win326windef8MAKELONGFttZk
> (uint win32.windef.MAKELONG(ushort,
> ushort))	C:\Users\Derek\Documents\Visual Studio
> 2012\Projects\WindowsApp1\WindowsApp1\	
>
> (One example)
>
> I reckon this means that I need to build a library for this and
> probably other files, but I haven't found any instructions to do
> so. Furthermore, all of the function in winuser.d link perfectly
> fine, so this just confuses me.
>
> So what do I need to do to make this compile and link correctly?

everything on dsource is quite outdated. try this instead

https://github.com/AndrejMitrovic/DWinProgramming/tree/master/WindowsAPI
April 11, 2014
On Friday, 11 April 2014 at 04:07:55 UTC, evilrat wrote:
> everything on dsource is quite outdated. try this instead
>
> https://github.com/AndrejMitrovic/DWinProgramming/tree/master/WindowsAPI

I downloaded that and ran dmd_build.bat, it produced dmd_win32_x32.lib which I put in the dmd2/windows/lib folder. I then added it to my linker library files. This made MAKELONG link, but LOWORD and HIWORD still don't link (again, really weird because they're defined in the same file):

Error	1	Error 42: Symbol Undefined _D5win326windef6LOWORDFmZt (ushort win32.windef.LOWORD(ulong))	C:\Users\Derek\Documents\Visual Studio 2012\Projects\WindowsApp1\WindowsApp1\	

Error	2	Error 42: Symbol Undefined _D5win326windef6HIWORDFmZt (ushort win32.windef.HIWORD(ulong))	C:\Users\Derek\Documents\Visual Studio 2012\Projects\WindowsApp1\WindowsApp1\	
April 11, 2014
On Friday, 11 April 2014 at 04:31:42 UTC, Derek wrote:
> On Friday, 11 April 2014 at 04:07:55 UTC, evilrat wrote:
>> everything on dsource is quite outdated. try this instead
>>
>> https://github.com/AndrejMitrovic/DWinProgramming/tree/master/WindowsAPI
>
> I downloaded that and ran dmd_build.bat, it produced dmd_win32_x32.lib which I put in the dmd2/windows/lib folder. I then added it to my linker library files. This made MAKELONG link, but LOWORD and HIWORD still don't link (again, really weird because they're defined in the same file):
>
> Error	1	Error 42: Symbol Undefined _D5win326windef6LOWORDFmZt (ushort win32.windef.LOWORD(ulong))	C:\Users\Derek\Documents\Visual Studio 2012\Projects\WindowsApp1\WindowsApp1\	
>
> Error	2	Error 42: Symbol Undefined _D5win326windef6HIWORDFmZt (ushort win32.windef.HIWORD(ulong))	C:\Users\Derek\Documents\Visual Studio 2012\Projects\WindowsApp1\WindowsApp1\	

if they are templates try make them plain function
April 11, 2014
On Friday, 11 April 2014 at 04:55:58 UTC, evilrat wrote:
> if they are templates try make them plain function
They're not, they're just ordinary functions:

// Links.
uint MAKELONG(ushort a, ushort b) {
	return cast(uint) ((b << 16) | a);
}

// Does not link.
uint MAKELONG(uint a, uint b) {
    assert((a & 0xFFFF0000) == 0);
    assert((b & 0xFFFF0000) == 0);
    return MAKELONG(cast(ushort)a, cast(ushort)b);
}

// Does not link.
ushort LOWORD(ulong l) {
	return cast(ushort) l;
}

// Does not link.
ushort HIWORD(ulong l) {
	return cast(ushort) (l >>> 16);
}


I grepped to see if MAKELONG was defined somewhere else as well, but it's not.
April 11, 2014
On Friday, 11 April 2014 at 05:14:56 UTC, Derek wrote:
> On Friday, 11 April 2014 at 04:55:58 UTC, evilrat wrote:
>> if they are templates try make them plain function
> They're not, they're just ordinary functions:
>
> // Links.
> uint MAKELONG(ushort a, ushort b) {
> 	return cast(uint) ((b << 16) | a);
> }
>
> // Does not link.
> uint MAKELONG(uint a, uint b) {
>     assert((a & 0xFFFF0000) == 0);
>     assert((b & 0xFFFF0000) == 0);
>     return MAKELONG(cast(ushort)a, cast(ushort)b);
> }
>
> // Does not link.
> ushort LOWORD(ulong l) {
> 	return cast(ushort) l;
> }
>
> // Does not link.
> ushort HIWORD(ulong l) {
> 	return cast(ushort) (l >>> 16);
> }
>
>
> I grepped to see if MAKELONG was defined somewhere else as well, but it's not.

I've found another I believe related example. The constant RICHEDIT_CLASS in richedit.d. Trying to use it gives the linking error:

Error	1	Error 42: Symbol Undefined _D5win328richedit14RICHEDIT_CLASSxAa (const(char[]) win32.richedit.RICHEDIT_CLASS)	C:\Users\Derek\Documents\Visual Studio 2012\Projects\WindowsApp1\WindowsApp1\	

It is defined in richedit.d as:

version(Unicode) {
	const wchar[] RICHEDIT_CLASS = "RichEdit20W";
} else {
	const char[] RICHEDIT_CLASS  = "RichEdit20A";
}

(And FTR my project is compiling in ANSI mode)
April 12, 2014
On Friday, 11 April 2014 at 06:25:19 UTC, Derek wrote:
>
> It is defined in richedit.d as:
>
> version(Unicode) {
> 	const wchar[] RICHEDIT_CLASS = "RichEdit20W";
> } else {
> 	const char[] RICHEDIT_CLASS  = "RichEdit20A";
> }
>
> (And FTR my project is compiling in ANSI mode)

and this could be rewritted as enum instead of array. but why all this start happens on 2.065?
April 12, 2014
On Saturday, 12 April 2014 at 04:45:14 UTC, evilrat wrote:
> and this could be rewritted as enum instead of array. but why all this start happens on 2.065?

I figured out my problem. When I changed the win32 library I was using I replaced the src dir, but not the import dir, and as a result the symbols that weren't linking had different types in the import files versus the library. So fixing it was just a matter of replacing the import directory with the correct version.

For the record, I figured this out by using libunres -d to look for the missing symbols in the library, and then a short demangling program I wrote (using std.demangle) to reveal the types of the library symbols and the expected symbols, this pointed me in the right direction to realize that there import and src directories were different.

It's building now, thanks for your help.
1 2 3 4
Next ›   Last »