www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ide - I can't Hello World!

reply Better World <sleepy keyboard.dot> writes:
So this is my first few hours doing D. I installed DMD and 
VisualD on VS 2015. Doing the tour in https://tour.dlang.org/, 
the programs build fine but no print statements come out in the 
output pane. That's what comes out instead:

C:\Windows\SysWOW64\kernel32.dll unloaded.
C:\Windows\SysWOW64\ucrtbase.dll unloaded.
C:\Windows\SysWOW64\dbghelp.dll unloaded.
The thread 0x38d0 has exited with code 0 (0x0).
The thread 0x3668 has exited with code 0 (0x0).
The thread 0x3510 has exited with code 0 (0x0).
The program '[14112] SeriousD.exe' has exited with code 0 (0x0).

What can I do?
Mar 03 2017
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 04.03.2017 07:14, Better World wrote:
 So this is my first few hours doing D. I installed DMD and VisualD on VS
 2015. Doing the tour in https://tour.dlang.org/, the programs build fine
 but no print statements come out in the output pane. That's what comes
 out instead:

 C:\Windows\SysWOW64\kernel32.dll unloaded.
 C:\Windows\SysWOW64\ucrtbase.dll unloaded.
 C:\Windows\SysWOW64\dbghelp.dll unloaded.
 The thread 0x38d0 has exited with code 0 (0x0).
 The thread 0x3668 has exited with code 0 (0x0).
 The thread 0x3510 has exited with code 0 (0x0).
 The program '[14112] SeriousD.exe' has exited with code 0 (0x0).

 What can I do?
The output pane only shows messages from the debugger. The program output is displayed in a console window which you probably see flashing. If you press Ctrl+F5, the program is run without debugger, but won't close the console window unless you press a key.
Mar 03 2017
parent reply Better World <sleepy keyboard.dot> writes:
On Saturday, 4 March 2017 at 07:58:45 UTC, Rainer Schuetze wrote:
 If you press Ctrl+F5, the program is run without debugger, but 
 won't close the console window unless you press a key.
Thank you. I tried your advice but I see no console either way. I inserted a Thread.sleep() call and apparently it delays the program termination but doesn't allow me to see the console still. Inserting a call to readln() instead results in a bad descriptor exception.
Mar 04 2017
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 05.03.2017 01:44, Better World wrote:
 On Saturday, 4 March 2017 at 07:58:45 UTC, Rainer Schuetze wrote:
 If you press Ctrl+F5, the program is run without debugger, but won't
 close the console window unless you press a key.
Thank you. I tried your advice but I see no console either way. I inserted a Thread.sleep() call and apparently it delays the program termination but doesn't allow me to see the console still. Inserting a call to readln() instead results in a bad descriptor exception.
I suspect you started from a Windows Application template. You should then switch the "Subsystem" to "Console" (on the "General" page of the project configuration settings).
Mar 05 2017
next sibling parent reply Better World <sleepy keyboard.dot> writes:
On Sunday, 5 March 2017 at 19:57:56 UTC, Rainer Schuetze wrote:
 I suspect you started from a Windows Application template. You 
 should then switch the "Subsystem" to "Console" (on the 
 "General" page of the project configuration settings).
Thank you. that worked. I appreciate a little explanation of why it didn't work and now works.
Mar 06 2017
parent Rainer Schuetze <r.sagitario gmx.de> writes:
On 07.03.2017 02:25, Better World wrote:
 On Sunday, 5 March 2017 at 19:57:56 UTC, Rainer Schuetze wrote:
 I suspect you started from a Windows Application template. You should
 then switch the "Subsystem" to "Console" (on the "General" page of the
 project configuration settings).
Thank you. that worked. I appreciate a little explanation of why it didn't work and now works.
With subsystem "Windows", you tell the OS that your application will have a graphic UI with the usual windows. The OS will not create the console window in that case and the appropriate file handles will be invalid. Switching to subsystem "Console" will restore that behavior.
Mar 09 2017
prev sibling parent reply Jupiter <galeanoj2005 yahoo.com.ar> writes:
On Sunday, 5 March 2017 at 19:57:56 UTC, Rainer Schuetze wrote:
 On 05.03.2017 01:44, Better World wrote:
 On Saturday, 4 March 2017 at 07:58:45 UTC, Rainer Schuetze 
 wrote:
 If you press Ctrl+F5, the program is run without debugger, 
 but won't
 close the console window unless you press a key.
Thank you. I tried your advice but I see no console either way. I inserted a Thread.sleep() call and apparently it delays the program termination but doesn't allow me to see the console still. Inserting a call to readln() instead results in a bad descriptor exception.
I suspect you started from a Windows Application template. You should then switch the "Subsystem" to "Console" (on the "General" page of the project configuration settings).
Hi, I started Today with D and VS too, A quesiton please, When I compile with dmd in console I get a *.exe in my current directory. But when I compile with rdmd the exe is far away in User Local temp and with a long name, the same stuff with Visual Studio plugin. I am studying, no project yet, I want File alone compilation. Could I set the directory Output for rdmd as dmd is doing, in the current directory ? VS plugin is using rdmd, I believe. Perhaps,.. Could I switch to dmd in VS 2013? Greeting thanks. (sorry my english)
Mar 08 2017
next sibling parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 09.03.2017 02:32, Jupiter wrote:
 On Sunday, 5 March 2017 at 19:57:56 UTC, Rainer Schuetze wrote:
 On 05.03.2017 01:44, Better World wrote:
 On Saturday, 4 March 2017 at 07:58:45 UTC, Rainer Schuetze wrote:
 If you press Ctrl+F5, the program is run without debugger, but won't
 close the console window unless you press a key.
Thank you. I tried your advice but I see no console either way. I inserted a Thread.sleep() call and apparently it delays the program termination but doesn't allow me to see the console still. Inserting a call to readln() instead results in a bad descriptor exception.
I suspect you started from a Windows Application template. You should then switch the "Subsystem" to "Console" (on the "General" page of the project configuration settings).
Hi, I started Today with D and VS too, A quesiton please, When I compile with dmd in console I get a *.exe in my current directory. But when I compile with rdmd the exe is far away in User Local temp and with a long name, the same stuff with Visual Studio plugin. I am studying, no project yet, I want File alone compilation. Could I set the directory Output for rdmd as dmd is doing, in the current directory ? VS plugin is using rdmd, I believe. Perhaps,.. Could I switch to dmd in VS 2013? Greeting thanks. (sorry my english)
rdmd is used for script-like usage of D source files, so leaving an executable inside the source folder is considered undesired. Visual D only uses rdmd if you use "Compile and run/debug" on a single file. If you create a project, Visual D will usually create an output directory inside the project folder for you, but you can also configure this in the project configuration. Project builds use dmd for compilation, not rdmd.
Mar 10 2017
parent Jupiter <galeanoj2005 yahoo.com.ar> writes:
On Friday, 10 March 2017 at 08:02:18 UTC, Rainer Schuetze wrote:
 On 09.03.2017 02:32, Jupiter wrote:
[...]
rdmd is used for script-like usage of D source files, so leaving an executable inside the source folder is considered undesired. Visual D only uses rdmd if you use "Compile and run/debug" on a single file. If you create a project, Visual D will usually create an output directory inside the project folder for you, but you can also configure this in the project configuration. Project builds use dmd for compilation, not rdmd.
Ok, I understood. Thank you
Mar 15 2017
prev sibling parent reply Kagamin <spam here.lot> writes:
On Thursday, 9 March 2017 at 01:32:24 UTC, Jupiter wrote:
  But when I compile with rdmd the exe is far away
 in User Local temp and with a long name, the same stuff with 
 Visual Studio plugin.
Undocumented, but --build-only option will write exe to the current directory, rdmd also supports dmd's -of option.
Mar 17 2017
parent reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
On Friday, 17 March 2017 at 10:30:50 UTC, Kagamin wrote:
 On Thursday, 9 March 2017 at 01:32:24 UTC, Jupiter wrote:
  But when I compile with rdmd the exe is far away
 in User Local temp and with a long name, the same stuff with 
 Visual Studio plugin.
Undocumented, but --build-only option
It's literally the first documented option of `rdmd --help` and `man rdmd` :)
Mar 18 2017
parent Kagamin <spam here.lot> writes:
On Saturday, 18 March 2017 at 22:37:07 UTC, Vladimir Panteleev 
wrote:
 It's literally the first documented option of `rdmd --help` and 
 `man rdmd` :)
https://issues.dlang.org/show_bug.cgi?id=17262 I mean docs on the site, didn't check `rdmd --help`
Mar 20 2017