www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Strange error: incompatible with i386 output

reply Chad J <gamerChad _spamIsBad_gmail.com> writes:
I am trying to get D working on my latest Linux install, but I am 
running into this error.

module main;

import tango.io.Stdout;

void main()
         Stdout("Hello world!").newline;

Trying to compile it:
<chad|~/c/dprojects/test> rebuild main.d
gcc ./_main.o -o main -m32 -Xlinker --start-group -ltango-base-dmd 
-lDD-tango-io -lDD-tango-sys -lDD-tango-stdc -lDD-tango-sys-linux 
-lDD-tango-stdc -lDD-tango-io -lDD-tango-text -lDD-tango-io -Xlinker 
-L/usr/lib -Xlinker -L/usr/lib -ltango-base-dmd -lpthread -lm
collect2: ld terminated with signal 11 [Segmentation fault]
i386:x86-64 architecture of input file 
is incompatible with i386 output
i386:x86-64 architecture of input file 
is incompatible with i386 output
--- errorlevel 1

Has anyone else run into this?

I am running a 64bit OS on a 64bit processor, but it has 32 bit 
emulation and all of this should be done in that.  I am not trying to 
compile 64 bit programs.  This compilation should be done with DMD 
1.027, and Tango was compiled with DMD 1.027.

Given Tango was compiled by DMD, I find it odd that gcc/ld would be 
saying that the tango libs are 64bit files.
Apr 25 2008
parent Chad J <gamerChad _spamIsBad_gmail.com> writes:
I figured it out.  It seems like an easy fix.

It really is running into 64 bit object files.  They were originally .c 
files, and the Tango make files didn't pass them the -m32 flag, so they 
ended up 64 bit.  I submitted a ticket to the Tango team:
Apr 26 2008