[phobos] 32 and 64 bit libraries on Linux

Jens Mueller jens.k.mueller at gmx.de
Wed Jan 5 02:10:02 PST 2011


Walter Bright wrote:
> The command and the barf:
> 
> gcc foo.o -o foo -m32 -Xlinker -L/home/walter/cbx/mars1/phobos
> -lphobos -lpthread -lm
> /usr/bin/ld: skipping incompatible
> /home/walter/cbx/mars1/phobos/libphobos.a when searching for
> -lphobos
> /usr/bin/ld: cannot find -lphobos
> collect2: ld returned 1 exit status
> --- errorlevel 1

This is strange. The following works for me.
hello.d:
import std.stdio;
void main() {
    writeln("Hello World");
}

$ dmd -c hello.d
$ gcc -m32 hello.o -o hello -L/home/jkm/local/x86_64-linux-gnu/lib -lphobos2 -lpthread
$ ./hello
Hello World

I using phobos2 here. I suppose there is something wrong with your
libphobos.a because it gets ignored.

Jens


More information about the phobos mailing list