What’s the difference of “./configure” option “–build”, “–host” and “–target”?

As noted in this blog post and alluded to in the GCC Configure Terms, –target only applies when you are compiling toolchains. When you are doing normal cross-compilation of a library or binary you use –build=the architecture of the build machine –host=the architecture that you want the file to run on However, when you are … Read more

Error “gnu/stubs-32.h: No such file or directory” while compiling Nachos source code

You’re missing the 32 bit libc dev package: On Ubuntu it’s called libc6-dev-i386 – do sudo apt-get install libc6-dev-i386. See below for extra instructions for Ubuntu 12.04. On Red Hat distros, the package name is glibc-devel.i686 (Thanks to David Gardner’s comment). On CentOS 5.8, the package name is glibc-devel.i386 (Thanks to JimKleck’s comment). On CentOS … Read more

ffmpeg for a android (using tutorial: “ffmpeg and Android.mk”)

After looking around the net. The only working solution I found is supplied by Bambuser which ported ffmpeg to use in their android application. Code is here: http://bambuser.com/opensource Basically you copy the .so files to your jni/lib directory, along with any .h files you might need, create a JNI wrapper through javah, and it works. … Read more

How to Compile for OS X in Linux or Windows?

For Linux, there is a prebuilt GCC cross-compiler (from publicly available Apple’s modified GCC sources). https://launchpad.net/~flosoft/+archive/cross-apple Update for 2015 After so many years, the industry-standard IDE now supports OSX/iOS/Android. http://channel9.msdn.com/Events/Visual-Studio/Connect-event-2014/311 Embarcadero’s RadStudio also supports building OSX/iOS/Android apps on Windows. This answer by Thomas also provides a cross-compilation tool. For all these options you still need … Read more

How to install the Raspberry Pi cross compiler on my Linux host machine?

I’m gonna try to write this as a tutorial for you so it becomes easy to follow. NOTE: This tutorial only works for older raspbian images. For the newer Raspbian based on Debian Buster see the following how-to in this thread: https://stackoverflow.com/a/58559140/869402 Pre-requirements Before you start you need to make sure the following is installed: … Read more

C++ cross-compiler from Windows to Linux [closed]

crosstool-ng supports building cross-compilers with cygwin host. Overview: Install cygwin, with development packages Download crosstool-ng Extract the tarball (tar xvjf crosstool-ng*) Run ./configure When configure complains about a missing tool, go back to cygwin setup and install the corresponding package (e.g. flex, libtool, ncurses-devel) You’ll need at least the following: Devel/gperf Devel/bison Devel/byacc Devel/wget Devel/patch … Read more