www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Simple D program - Segmentation Fault

reply Dan900 <darkandan gmail.com> writes:
I tried to compile this code using 

gdc -o dodawanie dodawanie.d

import std.stdio;
void main() {
  int a = 6, b = 7;
  writefln(a+b);         // wynik dodawania nie zostanie zapisany do zmiennej
                         // tylko od razu przekazany funkcji writefln
}

If i try run this program after compile 

dan900 dan900-desktop:~/Programowanie/D/Dodawanie$ ./dodawanie
Segmentation fault

How i can fix this problem?

Kubuntu 9.04 Linux 86-64 2.6.28-11-generic
Apr 26 2009
next sibling parent downs <default_357-line yahoo.de> writes:
Dan900 wrote:
 I tried to compile this code using 
 
 gdc -o dodawanie dodawanie.d
 
 import std.stdio;
 void main() {
   int a = 6, b = 7;
   writefln(a+b);         // wynik dodawania nie zostanie zapisany do zmiennej
                          // tylko od razu przekazany funkcji writefln
 }
 
 If i try run this program after compile 
 
 dan900 dan900-desktop:~/Programowanie/D/Dodawanie$ ./dodawanie
 Segmentation fault
 
 How i can fix this problem?
 
 Kubuntu 9.04 Linux 86-64 2.6.28-11-generic
Are you using an experimental, unsupported 4.2 version of GDC on 64-bit? If so, well, it's known broken. Try to downgrade to 4.1, or even better, build from source.
Apr 26 2009
prev sibling parent Dan900 <darkandan gmail.com> writes:
After installing 4.1 version of compiler

dan900 dan900-desktop:~/Programowanie/D/Dodawanie$ ./dodawanie
6

Thank you very much

Daniel Kucner

downs Wrote:

 Dan900 wrote:
 I tried to compile this code using 
 
 gdc -o dodawanie dodawanie.d
 
 import std.stdio;
 void main() {
   int a = 6, b = 7;
   writefln(a+b);         // wynik dodawania nie zostanie zapisany do zmiennej
                          // tylko od razu przekazany funkcji writefln
 }
 
 If i try run this program after compile 
 
 dan900 dan900-desktop:~/Programowanie/D/Dodawanie$ ./dodawanie
 Segmentation fault
 
 How i can fix this problem?
 
 Kubuntu 9.04 Linux 86-64 2.6.28-11-generic
Are you using an experimental, unsupported 4.2 version of GDC on 64-bit? If so, well, it's known broken. Try to downgrade to 4.1, or even better, build from source.
Apr 26 2009