# Compiling 32bit on 64bit; issues installing i386 environment



## Armie (May 28, 2013)

Greetings,

I have a FreeBSD 64bit machine on which I would like to compile some 32bit code. Compiling very simple test programs works, but #include <new> causes the program not to compile because it seems that the 64bit of <new> is used. So I decided to attempt and install the i386 environment and compile from within that environment. This seems to be the general "normal" way to compile 32bit applications on amd64 installations.

`# make buildworld TARGET=i386 DESTDIR=/compat/i386` fails with the following error:

```
/libexec/ld-elf.so.1: /usr/lib/libstdc++.so.6: unsupported file layout
```

This led me to believe that the 32bit libraries were not installed but this was not the case. In any case, I ran `# cd /usr/src && make build32 install32 && ldconfig -v -m -R /usr/lib32` but this did not change anything. `Buildworld` still fails. I have also exported LD_LIBRARY_32_PATH and LD_32_LIBRARY_PATH (I found mentions to both when searching for this problem so exported both) but this did not seem to solve my problem.

Any idea on how to solve this?


----------

