Visual D 0.3.43 beta1 available

johann via Digitalmars-d-ide digitalmars-d-ide at puremagic.com
Thu Nov 5 23:45:20 PST 2015


On Thursday, 5 November 2015 at 20:27:32 UTC, Rainer Schuetze 
wrote:
>
>
> On 05.11.2015 12:11, johann wrote:
>> On Thursday, 5 November 2015 at 11:07:04 UTC, johann wrote:
>>> On Wednesday, 4 November 2015 at 18:33:49 UTC, Rainer 
>>> Schuetze wrote:
>>>>
>>>>
>>>> On 04.11.2015 10:32, tester wrote:
>>>>> [...]
>>>>
>>>> It seems it fails to add legacy_stdio_definitions.lib to the 
>>>> link
>>>> command line. You could try to add it to the "additional 
>>>> linker
>>>> options" in the globl settings as a workaround.
>>>
>>> could you import that automatically?
>>> i just made an console program with nothing in it - except 
>>> the main.d
>>> with the content:
>>>
>>> import std.stdio;
>>>
>>> int main(string[] argv)
>>> {
>>>     writeln("Hello D-World!");
>>>     return 0;
>>> }
>>
>> now getting another error:
>> LIBCMT.lib(exe_winmain.obj) : error LNK2019: unresolved 
>> external symbol
>> WinMain referenced in function "int __cdecl
>> __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ)
>
> I guess you have changed the subsystem to "Windows". main 
> doesn't seem to work then (only for "Console"), you'll have to 
> implement WinMain as in the WindowsApplication template.

thanks for the help pointers.
i generated the dfl2 lib anew with the current compiler - works 
fine for x64. the lib was seemingly maintained by a gentleman 
named franklike.
as for main, i used the following code:

import dfl.all;
int main()
{
	Form myForm;
	Label myLabel;
	myForm = new Form;
	myForm.text = "DFL Example";
	myLabel = new Label;
	myLabel.font = new Font("Verdana", 14f);
	myLabel.text = "Hello, DFL World!";
	myLabel.location = Point(15, 15);
	myLabel.autoSize = true;
	myLabel.parent = myForm;
	Application.run(myForm);
	return 0;
}

i set the subsystem to console (or 'Not Set') and try to link 
with the dfl2 lib. that works for console and it runs as expected 
- just with console window in the background.

if i set it to windows subsystem the link fails with:
LIBCMT.lib(exe_winmain.obj) : error LNK2019: unresolved external 
symbol WinMain referenced in function "int __cdecl 
__scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ)
Release\dflTEST.exe : fatal error LNK1120: 1 unresolved externals
Building Release\dflTEST.exe failed!

do you have any suggestion what happens? how can i get rid of the 
console window after linking?





More information about the Digitalmars-d-ide mailing list