www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Windows 10 Linux Bash Shell: Compiling linux app on windows

reply Andre Pany <andre s-e-a-p.de> writes:
Hi,

I play around with the new windows 10 feature to run a linux
sub system on windows.

-> Installing dmd is working fine with the command
curl -fsS https://dlang.org/install.sh | bash -s dmd

-> Activating dmd is also working
source ~/dlang/dmd-2.071.1/activate

-> dmd can be started and shows correct version
dmd --version.

-> Compiling a hello world works, linking fails
"dmd test -c" creates a test.o file

but "dmd test" fails with error:
cc: no such file or directory
--- errorlevel 255

Do you have an idea how to fix the linker issue?

Kind regards
André
Aug 06 2016
next sibling parent reply Rattle Weird Hole <dlw blabla.io> writes:
On Saturday, 6 August 2016 at 17:18:51 UTC, Andre Pany wrote:
 Hi,

 I play around with the new windows 10 feature to run a linux
 sub system on windows.

 -> Installing dmd is working fine with the command
 curl -fsS https://dlang.org/install.sh | bash -s dmd

 -> Activating dmd is also working
 source ~/dlang/dmd-2.071.1/activate

 -> dmd can be started and shows correct version
 dmd --version.

 -> Compiling a hello world works, linking fails
 "dmd test -c" creates a test.o file

 but "dmd test" fails with error:
 cc: no such file or directory
 --- errorlevel 255

 Do you have an idea how to fix the linker issue?

 Kind regards
 André
ld must be found in the environment ?
Aug 06 2016
parent Andre Pany <andre s-e-a-p.de> writes:
On Saturday, 6 August 2016 at 17:26:05 UTC, Rattle Weird Hole 
wrote:
 ld must be found in the environment ?
Yes ld was missing, by installing the build-essentials dmd is running fine: sudo apt-get install build-essential Kind regards André
Aug 06 2016
prev sibling next sibling parent ZombineDev <petar.p.kirov gmail.com> writes:
On Saturday, 6 August 2016 at 17:18:51 UTC, Andre Pany wrote:
 Hi,

 I play around with the new windows 10 feature to run a linux
 sub system on windows.

 -> Installing dmd is working fine with the command
 curl -fsS https://dlang.org/install.sh | bash -s dmd

 -> Activating dmd is also working
 source ~/dlang/dmd-2.071.1/activate

 -> dmd can be started and shows correct version
 dmd --version.

 -> Compiling a hello world works, linking fails
 "dmd test -c" creates a test.o file

 but "dmd test" fails with error:
 cc: no such file or directory
 --- errorlevel 255

 Do you have an idea how to fix the linker issue?

 Kind regards
 André
Just like on a regular linux distro, you need to have installed standard development tools such as a C compiler toolchain. Since the install script on dlang's homepage is not a deb package it doesn't verify if those dependencies are fulfilled. I think running "sudo apt-get install build-essential" in bash.exe should do it (install C compiler and a "cc" alias to it). The other option is to download the Ubuntu/Debian x86_64 .deb package and do "sudo dpkg -i" on it: http://downloads.dlang.org/releases/2.x/2.071.1/dmd_2.071.1-0_amd64.deb and it will find the missing dependencies, so you can later install them, like described here: http://superuser.com/questions/196864/how-to-install-local-deb-packages-with-apt-get
Aug 06 2016
prev sibling parent cym13 <cpicard openmailbox.org> writes:
On Saturday, 6 August 2016 at 17:18:51 UTC, Andre Pany wrote:
 Hi,

 I play around with the new windows 10 feature to run a linux
 sub system on windows.

 -> Installing dmd is working fine with the command
 curl -fsS https://dlang.org/install.sh | bash -s dmd
Just a side note but it's a really bad idea to pipe curl in bash as it opens the door to remote unknown code exploitation. Even checking what curl returns beforehand isn't enough as a piped curl is distinguishable server-side so a different script could be provided dynamically. (Ok, with dlang.org there shouldn't be much problem but still)
Aug 06 2016