Re: Installing DMD on linux via snap

2022-05-18 Thread Jordi Sayol via Digitalmars-d-learn

El 18/5/22 a les 17:24, matheus via Digitalmars-d-learn ha escrit:


Yesterday I needed to install DMD on a fresh installed version of Linux, so 
since I was using Xubuntu I decided to use snap.





$ sudo wget https://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O 
/etc/apt/sources.list.d/d-apt.list

$ sudo apt update --allow-insecure-repositories && sudo apt -y --allow-unauthenticated 
install --reinstall d-apt-keyring && sudo apt update

then just install:

$ sudo apt install dmd-compiler dmd-tools dmd-doc dub


Re: Installing DMD on linux via snap

2022-05-18 Thread Alain De Vos via Digitalmars-d-learn

You could try on linux,
apt-cache search dmd
apt-cache search ldc
apt-cache search ldc2


Re: Installing DMD on linux via snap

2022-05-18 Thread matheus via Digitalmars-d-learn

On Wednesday, 18 May 2022 at 15:27:57 UTC, rikki cattermole wrote:

Snap package source: https://github.com/dlang-snaps/dmd.snap/

Hasn't been updated in 3 years.


I see... and even that I found my answer elsewhere, this problem 
was already discussed there: 
https://github.com/dlang-snaps/dmd.snap/issues (GCC isn't part of 
the dependencies).


But there was no further progress.

Matheus.


Re: Installing DMD on linux via snap

2022-05-18 Thread rikki cattermole via Digitalmars-d-learn

Snap package source: https://github.com/dlang-snaps/dmd.snap/

Hasn't been updated in 3 years.


Installing DMD on linux via snap

2022-05-18 Thread matheus via Digitalmars-d-learn

Hi,

Even my problem is already solved, I'm passing this information 
because I don't know if you are aware.


Yesterday I needed to install DMD on a fresh installed version of 
Linux, so since I was using Xubuntu I decided to use snap.


sudo snap install dmd

Then a warning appeared saying that because some permissions I 
should add --classic, OK I added and the installation proceeded.


So I just ran DMD alone and I got the version and some info, but 
when I tried to compile a simple Hello world to check if 
everything was really fine, I was greeted with this:


cc: No such file or directory
--- errorlevel 255

Looking online I found my answer, this was probably because it 
was missing GCC, then I did:


apt-get install build-essential

And after that it worked, but I wonder... couldn't we get a hint 
about this after or even before installing DMD?


I remember installing other applications and being asked to 
install additional libraries/packages. Couldn't we have the same?


Matheus.


Re: DMD on linux? (more problems)

2011-03-03 Thread Sean Eskapp
== Quote from Jesse Phillips (jessekphillip...@gmail.com)'s article
 Sean Eskapp Wrote:
  I'm still having issues with the linux dmd. Here's the relevant
part
  of the output:
 
  ...
  function  func
  function  func
  gcc Nullimorphism.o -o Nullimorphism.exe -g -m32 -l -Xlinker -
  L/usr/lib32 -Xlinker -L/usr/lib64 -Xlinker --no-warn-search-
mismatch
  -Xlinker --export-dynamic -lrt -lphobos2 -lpthread -lm
  /usr/bin/ld: cannot find -l-Xlinker
  collect2: ld returned 1 exit status
  --- errorlevel 1
  make[1]: *** [all] Error 1
  make[1]: Leaving directory
  ...
 
  Any help is appreciated.
 I think the part LD is tripping up on is -m32 -l -Xlinker
 So it seems you are calling dmd incorrectly or modified dmd.conf
incorrectly as there is no argument after -l so LD thinks you want
to link against lib-Xlinker.

Oops yeah, there was some obsolete in the makefile in my project.
Don't know how it managed to compile on windows, though..

Thanks, though, problem solved.


DMD on linux?

2011-03-02 Thread Sean Eskapp
I'm trying to work with D on Ubuntu, but I keep having this issue:

...
function  func
function  func
gcc Nullimorphism.o -o Nullimorphism.exe -g -m32 -l -Xlinker 
-L/usr/bin/../lib32 -Xlinker -
L/usr/bin/../lib64 -Xlinker --no-warn-search-mismatch -Xlinker --export-dynamic 
-lrt -
lphobos2 -lpthread -lm
/usr/bin/ld: cannot find -l-Xlinker
/usr/bin/ld: cannot find -lphobos2
collect2: ld returned 1 exit status
--- errorlevel 1
make[1]: *** [all] Error 1
...

I downloaded the DMD v2.052 ZIP from the download page, extracted the linux/bin 
folder into
/usr/bin, the linux/lib64 folder into /usr/lib64, and the src folder into 
/usr/src. Can
somebody please help?


Re: DMD on linux?

2011-03-02 Thread Jonathan M Davis
On Wednesday, March 02, 2011 13:52:29 Sean Eskapp wrote:
 I'm trying to work with D on Ubuntu, but I keep having this issue:
 
 ...
 function  func
 function  func
 gcc Nullimorphism.o -o Nullimorphism.exe -g -m32 -l -Xlinker
 -L/usr/bin/../lib32 -Xlinker - L/usr/bin/../lib64 -Xlinker
 --no-warn-search-mismatch -Xlinker --export-dynamic -lrt - lphobos2
 -lpthread -lm
 /usr/bin/ld: cannot find -l-Xlinker
 /usr/bin/ld: cannot find -lphobos2
 collect2: ld returned 1 exit status
 --- errorlevel 1
 make[1]: *** [all] Error 1
 ...
 
 I downloaded the DMD v2.052 ZIP from the download page, extracted the
 linux/bin folder into /usr/bin, the linux/lib64 folder into /usr/lib64,
 and the src folder into /usr/src. Can somebody please help?

1. I never bother installing the zip anywhere. If you just unzip it and add 
/path/to/unzipped/dmd2/linux/bin to your path, then you should be fine. I don't 
see any real reason to actual try and install dmd into your system folders 
(though you obviously can if you want to).

2. Assuming that you _do_ move files around, you need to adjust your dmd.conf 
so 
that it points to the appropriate places.

3. If you just moved files around, then you might not _have_ a dmd.conf, and 
you're doubly screwed.

Take a look at the documentation page for dmd on linux:
http://www.digitalmars.com/d/2.0/dmd-linux.html

It's slightly out of date, since with the last release, 64-bit support was 
added, and the 32-bit version of libphobos.a is in 
/path/to/unzipped/dmd2/linux/lib32 and the 64-bit version is in 
/path/to/unzipped/dmd2/linux/lib64, but the instructions should be correct 
otherwise.

You need to make sure that dmd is on your path and that a version of dmd.conf 
which points to the place where libphobos2.a is is in one of the places that 
dmd 
looks for dmd.conf (as described on that page). Also, make sure that you're 
using a dmd.conf based on the most recent version, or you could be missing 
necessary linker flags.

- Jonathan M Davis


Re: DMD on linux?

2011-03-02 Thread Sean Eskapp
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article
 On Wednesday, March 02, 2011 13:52:29 Sean Eskapp wrote:
  I'm trying to work with D on Ubuntu, but I keep having this
issue:
 
  ...
  function  func
  function  func
  gcc Nullimorphism.o -o Nullimorphism.exe -g -m32 -l -Xlinker
  -L/usr/bin/../lib32 -Xlinker - L/usr/bin/../lib64 -Xlinker
  --no-warn-search-mismatch -Xlinker --export-dynamic -lrt -
lphobos2
  -lpthread -lm
  /usr/bin/ld: cannot find -l-Xlinker
  /usr/bin/ld: cannot find -lphobos2
  collect2: ld returned 1 exit status
  --- errorlevel 1
  make[1]: *** [all] Error 1
  ...
 
  I downloaded the DMD v2.052 ZIP from the download page,
extracted the
  linux/bin folder into /usr/bin, the linux/lib64 folder into
/usr/lib64,
  and the src folder into /usr/src. Can somebody please help?
 1. I never bother installing the zip anywhere. If you just unzip
it and add
 /path/to/unzipped/dmd2/linux/bin to your path, then you should be
fine. I don't
 see any real reason to actual try and install dmd into your system
folders
 (though you obviously can if you want to).
 2. Assuming that you _do_ move files around, you need to adjust
your dmd.conf so
 that it points to the appropriate places.
 3. If you just moved files around, then you might not _have_ a
dmd.conf, and
 you're doubly screwed.
 Take a look at the documentation page for dmd on linux:
 http://www.digitalmars.com/d/2.0/dmd-linux.html
 It's slightly out of date, since with the last release, 64-bit
support was
 added, and the 32-bit version of libphobos.a is in
 /path/to/unzipped/dmd2/linux/lib32 and the 64-bit version is in
 /path/to/unzipped/dmd2/linux/lib64, but the instructions should be
correct
 otherwise.
 You need to make sure that dmd is on your path and that a version
of dmd.conf
 which points to the place where libphobos2.a is is in one of the
places that dmd
 looks for dmd.conf (as described on that page). Also, make sure
that you're
 using a dmd.conf based on the most recent version, or you could be
missing
 necessary linker flags.
 - Jonathan M Davis

Hmm my dmd.conf seems fine, but since the .deb has been updated, I
can just use that. Thanks!


DMD on linux? (more problems)

2011-03-02 Thread Sean Eskapp
I'm still having issues with the linux dmd. Here's the relevant part
of the output:

...
function  func
function  func
gcc Nullimorphism.o -o Nullimorphism.exe -g -m32 -l -Xlinker -
L/usr/lib32 -Xlinker -L/usr/lib64 -Xlinker --no-warn-search-mismatch
-Xlinker --export-dynamic -lrt -lphobos2 -lpthread -lm
/usr/bin/ld: cannot find -l-Xlinker
collect2: ld returned 1 exit status
--- errorlevel 1
make[1]: *** [all] Error 1
make[1]: Leaving directory
...

Any help is appreciated.


Re: DMD on linux? (more problems)

2011-03-02 Thread Jacob Carlborg

On 2011-03-03 00:43, Sean Eskapp wrote:

I'm still having issues with the linux dmd. Here's the relevant part
of the output:

...
function  func
function  func
gcc Nullimorphism.o -o Nullimorphism.exe -g -m32 -l -Xlinker -
L/usr/lib32 -Xlinker -L/usr/lib64 -Xlinker --no-warn-search-mismatch
-Xlinker --export-dynamic -lrt -lphobos2 -lpthread -lm
/usr/bin/ld: cannot find -l-Xlinker
collect2: ld returned 1 exit status
--- errorlevel 1
make[1]: *** [all] Error 1
make[1]: Leaving directory
...

Any help is appreciated.


You can give this a try: https://bitbucket.org/doob/dvm/wiki/Home

--
/Jacob Carlborg


Why is my code does not compile? (dmd 2.021 linux)

2008-12-12 Thread Weed


void main()
{
int i;

ref int func()
{
  return i;
}

func() = 4;
}

lval.d(5): found 'ref' instead of statement
lval.d(10): no identifier for declarator func
lval.d(11): unrecognized declaration


but code like this compiles:

ref int func()
{
  int* i = new int;
  return *i;
}

void main()
{
func() = 4;
}


Re: Why is my code does not compile? (dmd 2.021 linux)

2008-12-12 Thread Bill Baxter
On Sat, Dec 13, 2008 at 5:45 AM, Weed resume...@mail.ru wrote:

 void main()
 {
int i;

ref int func()
{
  return i;
}

func() = 4;
 }

 lval.d(5): found 'ref' instead of statement
 lval.d(10): no identifier for declarator func
 lval.d(11): unrecognized declaration


 but code like this compiles:

 ref int func()
 {
  int* i = new int;
  return *i;
 }

 void main()
 {
func() = 4;
 }


Ref return values are a very new feature in D2.  I suspect its just a
bug that they don't work on inner functions yet.

--bb


Re: Why is my code does not compile? (dmd 2.021 linux)

2008-12-12 Thread Weed

Bill Baxter пишет:

On Sat, Dec 13, 2008 at 5:45 AM, Weed resume...@mail.ru wrote:

void main()
{
   int i;

   ref int func()
   {
 return i;
   }

   func() = 4;
}

lval.d(5): found 'ref' instead of statement
lval.d(10): no identifier for declarator func
lval.d(11): unrecognized declaration


but code like this compiles:

ref int func()
{
 int* i = new int;
 return *i;
}

void main()
{
   func() = 4;
}



Ref return values are a very new feature in D2.  I suspect its just a
bug that they don't work on inner functions yet.

--bb


message implies that the authors are aware of this limitation? report 
they do not need?


Re: Why is my code does not compile? (dmd 2.021 linux)

2008-12-12 Thread Bill Baxter
2008/12/13 Weed resume...@mail.ru:
 Bill Baxter пишет:

 On Sat, Dec 13, 2008 at 5:45 AM, Weed resume...@mail.ru wrote:

 void main()
 {
   int i;

   ref int func()
   {
 return i;
   }

   func() = 4;
 }

 lval.d(5): found 'ref' instead of statement
 lval.d(10): no identifier for declarator func
 lval.d(11): unrecognized declaration


 but code like this compiles:

 ref int func()
 {
  int* i = new int;
  return *i;
 }

 void main()
 {
   func() = 4;
 }


 Ref return values are a very new feature in D2.  I suspect its just a
 bug that they don't work on inner functions yet.

 --bb

 message implies that the authors are aware of this limitation? report they
 do not need?

No, a report is probably needed.  There are lots of bugs with the new
const and ref features in D2.  Many have been reported, but there are
still many more to be discovered.  Returning refs in particular is
very new, so I would expect bugs a plenty with that, though I think
few have been reported so far.  I don't keep up with the bugs
newsgroup these days, though.  Certainly try to search for it in the
bug db before filing a new report, though.  D's bugzilla is here:
http://d.puremagic.com/issues/

--bb