No Output with shebang.

Newbie via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 20 13:23:14 PDT 2014


On Wednesday, 20 August 2014 at 20:21:13 UTC, anonymous wrote:
> On Wednesday, 20 August 2014 at 20:17:49 UTC, Newbie wrote:
>> #!/usr/bin/gdc
>>
>> import std.stdio;
>> void main()
>> {
>>     writeln("Hello, world with automated script running!");
>> }
>>
>> When I compile the code above normal to an a.out binary it runs
>> like expected. But running it with shebang it does nothing. No
>> output, especially no error message. Nothing.
>>
>> What do I wrong?
>
> gdc just compiles the program to a.out. It doesn't run the
> resulting executable. You need to use something like rdmd 
> instead
> of gdc. rdmd compiles to some temporary location and then runs
> the executable.

Wow, that was fast. Thanks a lot!



More information about the Digitalmars-d-learn mailing list