Crosscompiling in linux x86_64 - Help please! lazarus / 1-Linux ---------------------------------------------------------------------- minesadorada · 2016-10-31 16:02 I built fpc and lazarus from source, and can crosscompile to either: Linux 64-bit and Windows 64-bit or Linux 32-bit and Windows 32-bit. But not both. I know I'm missing something obvious, but being a linux beginner, I know not what. Currently, my fpc -i outputs: Compiler CPU target: x86_64 and my make info outputs: fpc ...... /usr/bin/ppcx64 I have executed the make all and crosscompile CPU_TARGET=i386 for linux and win32, also CPU_TARGET= x86_64 and the libraries are there for fpc. I just can't get all the linux 32-bit/64-bit and Windows 32-bit and 64-bit targets to work.  It's SOO close, but I'm missing something simple, I'm sure. My current configuration compiles linux x64 and Windows x64 with no problems. FPC.......... /usr/bin/ppcx64 But.. When I try to compile for linux32 for example, I get the error: Compile Project, Mode: Linux32, CPU: i386, Target: crossall_linux32: Exit code 256, Errors: 1 /usr/bin/ld: skipping incompatible //usr/lib/libpthread.so when searching for -lpthread /usr/bin/ld: skipping incompatible //usr/lib/libpthread.a when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib//libpthread.so when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib//libpthread.a when searching for -lpthread /usr/bin/ld: cannot find -lpthread /usr/bin/ld: skipping incompatible //usr/lib/libc.so when searching for -lc /usr/bin/ld: skipping incompatible //usr/lib/libc.a when searching for -lc /usr/bin/ld: skipping incompatible /usr/lib//libc.so when searching for -lc /usr/bin/ld: skipping incompatible /usr/lib//libc.a when searching for -lc /usr/bin/ld: cannot find -lc crossall.lpr(20,1) Error: Error while linking I have no idea how to fix it. I also have no idea what output/config files to show in order to diagnose my problem, so I'm hoping for an information request as a reply. ==edit== more info: My Linux OS is 'tahr Puppy', which is an Ubuntu-compatible distro.  It's running on an x86_64 system. The only Ubuntu Lazarus distribution was an older version, so I downloaded the Laz 1.6RC2 and fpc 3.0.0 sources, and compiled them. ---------------------------------------------------------------------- Leledumbo · 2016-10-31 16:41 Quote from: minesadorada on October 31, 2016, 05:02:35 pmBut.. When I try to compile for linux32 for example, I get the error: Compile Project, Mode: Linux32, CPU: i386, Target: crossall_linux32: Exit code 256, Errors: 1 /usr/bin/ld: skipping incompatible //usr/lib/libpthread.so when searching for -lpthread /usr/bin/ld: skipping incompatible //usr/lib/libpthread.a when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib//libpthread.so when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib//libpthread.a when searching for -lpthread /usr/bin/ld: cannot find -lpthread /usr/bin/ld: skipping incompatible //usr/lib/libc.so when searching for -lc /usr/bin/ld: skipping incompatible //usr/lib/libc.a when searching for -lc /usr/bin/ld: skipping incompatible /usr/lib//libc.so when searching for -lc /usr/bin/ld: skipping incompatible /usr/lib//libc.a when searching for -lc /usr/bin/ld: cannot find -lc crossall.lpr(20,1) Error: Error while linking I have no idea how to fix it. You need the 32-bit libraries and have -Fl option points to directory containing those libraries. In archlinux derivatives, there are multilib packages that install them. I don't know about other distros. ---------------------------------------------------------------------- Handoko · 2016-10-31 17:09 The 32-bit libraries package name for Ubuntu 64-bit is libc6-dev-x32. ---------------------------------------------------------------------- minesadorada · 2016-10-31 18:23 Quote from: Handoko on October 31, 2016, 06:09:40 pmThe 32-bit libraries package name for Ubuntu 64-bit is libc6-dev-x32. Installed, but didn't fix it. I think it's something more obvious and simple. Imagine you are a windows user that is ignorant of the simplest thing when installing fpc/lazarus under linux.  Who can compile via source only because of simple wiki instructions. Imagine you know next-to-nothing about configuring the fpc and lazarus cfg files.  When installing fpc, I chose /usr as the first option, for instance. That's where I am. ---------------------------------------------------------------------- minesadorada · 2016-11-01 13:04 I now have a project that succesfully compiles to: Linux 64bit Windows 64bit Windows 32bit It fails when compiling to Linux 32bit with: Compile Project, Mode: Linux32, CPU: i386, Target: crossall_linux32: Exit code 256, Errors: 1 /usr/bin/ld: skipping incompatible //usr/lib/libpthread.so when searching for -lpthread /usr/bin/ld: skipping incompatible //usr/lib/libpthread.a when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib//libpthread.so when searching for -lpthread /usr/bin/ld: skipping incompatible /usr/lib//libpthread.a when searching for -lpthread /usr/bin/ld: cannot find -lpthread /usr/bin/ld: skipping incompatible //usr/lib/libc.so when searching for -lc /usr/bin/ld: skipping incompatible //usr/lib/libc.a when searching for -lc /usr/bin/ld: skipping incompatible /usr/lib//libc.so when searching for -lc /usr/bin/ld: skipping incompatible /usr/lib//libc.a when searching for -lc /usr/bin/ld: cannot find -lc crossall.lpr(20,1) Error: Error while linking Any suggestions? ---------------------------------------------------------------------- Leledumbo · 2016-11-01 13:30 Quote from: minesadorada on November 01, 2016, 02:04:20 pmAny suggestions? Read carefully my instruction and follow it precisely.