www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Installing DMD on linux

reply torhu <fake address.dude> writes:
I've put libphobos.a in /usr/lib/.

I've installed everything else in ~/dmd, and added it to PATH.

when trying to compile something, I get this:

user ubuntu:~$ dmd test.d
gcc test.o -o test -m32 -Xlinker -L/home/user/dmd/bin/../lib -lphobos 
-lpthread -lm
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
--- errorlevel 1
Jul 08 2007
next sibling parent Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
torhu wrote:
 I've put libphobos.a in /usr/lib/.
 
 I've installed everything else in ~/dmd, and added it to PATH.
 
 when trying to compile something, I get this:
 
 user ubuntu:~$ dmd test.d
 gcc test.o -o test -m32 -Xlinker -L/home/user/dmd/bin/../lib -lphobos 
 -lpthread -lm
 /usr/bin/ld: crt1.o: No such file: No such file or directory
 collect2: ld returned 1 exit status
 --- errorlevel 1
That file is part of the C runtime library, IIRC. Can you successfully compile & link C programs with gcc?
Jul 08 2007
prev sibling parent reply "Anders Bergh" <anders1 gmail.com> writes:
On 7/8/07, torhu <fake address.dude> wrote:
 user ubuntu:~$ dmd test.d
Try apt-get install build-essential, which will install everything that's needed to build C applications. -- Anders
Jul 08 2007
parent reply torhu <fake address.dude> writes:
Anders Bergh wrote:
 On 7/8/07, torhu <fake address.dude> wrote:
 user ubuntu:~$ dmd test.d
Try apt-get install build-essential, which will install everything that's needed to build C applications.
I have a hard time believing that a default Ubuntu install is unable to build C applications. So the problem has to be something else.
Jul 08 2007
next sibling parent reply Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
torhu wrote:
 Anders Bergh wrote:
 On 7/8/07, torhu <fake address.dude> wrote:
 user ubuntu:~$ dmd test.d
Try apt-get install build-essential, which will install everything that's needed to build C applications.
I have a hard time believing that a default Ubuntu install is unable to build C applications. So the problem has to be something else.
Actually, I'm quite sure it is unable to do so (at least every version I've tried, which doesn't include 7.04). IIRC the reasoning is that "normal users" don't need to compile stuff, so they're one of the few Linux distributions (AFAIK) that don't install a full build environment by default. If you haven't installed build-essential (or at least the relevant packages on which it depends) I suggest you try that.
Jul 08 2007
parent reply Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
Frits van Bommel wrote:
 Actually, I'm quite sure it is unable to do so (at least every version 
 I've tried, which doesn't include 7.04).
Though I'm surprised it didn't complain about not having a program named 'gcc' if this was your problem. Did you install that manually? (I have a hard time believing they'd add gcc to the default install but forgot the C library) If you've installed gcc manually (apt-get install gcc) you may have forgotten to also install libc6-dev (which is recommended when installing gcc, but not a requirement -- though you'll need it in pretty much any normal program). Installing build-essential should make sure you didn't miss anything else...
Jul 08 2007
parent torhu <fake address.dude> writes:
Frits van Bommel wrote:
 Frits van Bommel wrote:
 Actually, I'm quite sure it is unable to do so (at least every version 
 I've tried, which doesn't include 7.04).
Though I'm surprised it didn't complain about not having a program named 'gcc' if this was your problem. Did you install that manually? (I have a hard time believing they'd add gcc to the default install but forgot the C library) If you've installed gcc manually (apt-get install gcc) you may have forgotten to also install libc6-dev (which is recommended when installing gcc, but not a requirement -- though you'll need it in pretty much any normal program). Installing build-essential should make sure you didn't miss anything else...
Installing build-essentials did the trick. gcc was already installed, and libc6-dev was not.
Jul 08 2007
prev sibling parent reply "Anders Bergh" <anders1 gmail.com> writes:
On 7/8/07, torhu <fake address.dude> wrote:
 I have a hard time believing that a default Ubuntu install is unable to
 build C applications.  So the problem has to be something else.
Just try it. Every time I installed Ubuntu I had to install build-essential for compiling to work. -- Anders
Jul 08 2007
parent torhu <fake address.dude> writes:
Anders Bergh wrote:
 On 7/8/07, torhu <fake address.dude> wrote:
 I have a hard time believing that a default Ubuntu install is unable to
 build C applications.  So the problem has to be something else.
Just try it. Every time I installed Ubuntu I had to install build-essential for compiling to work.
I'll try it the next time I boot into ubuntu. I'm actually using wubi-installer.org, which I'm quite happy with. Almost hassle-free linux/windows multiboot, it doesn't touch the MBR or partition tables at all. I spent four hours trying to get vmware player and vmware server to work properly. Not a pleasant experience, and it installs some stuff that slows down windows startup a lot. I just need linux for testing cross-platform code and build systems. Someone should file a bug telling Walter to fix the linux DMD install instructions. Just putting softlinks in /urs/local/bin does not work, because dmd won't find the phobos source that way. Either dmd.conf has to be fixed, or you have to put dmd/bin in your path instead of softlinking. I'm just mentioning it, in case someone feels like taking on that crusade. ;)
Jul 08 2007