what is cross compilation?

Cross-compilation is the act of compiling code for one computer system (often known as the target) on a different system, called the host. It’s a very useful technique, for instance when the target system is too small to host the compiler and all relevant files. Common examples include many embedded systems, but also typical game … Read more

How to list library dependencies of a non-native binary?

is there any way to get a list of the dynamically linked dependency for of a foreign binary You can list direct dependencies of a binary easily enough: readelf -d a.out | grep NEEDED 0x0000000000000001 (NEEDED) Shared library: [librt.so.1] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] I know of no way to recursively continue this to get … Read more

CMake: The C Compiler is not able to compile a simple test program

CMake tries to compile an executable using “standard” (as per what CMake thinks is standard) compiler options and tries to run that executable, so to see if the compiler is working. The executable is simple like int main(int argc, char *argv[]) { return argc – 1; }. You can’t do that when cross-compiling. Because usually … Read more

All possible GOOS value?

Note that those values are defined in: src/go/build/syslist.go, and doc/install/source#environment. With Go 1.5 (Q3 2015), GOARCH will become much more complete. See commit 1eebb91 by Minux Ma (minux) go/build: reserve GOARCH values for all common architectures Whenever we introduce a new GOARCH, older Go releases won’t recognize them and this causes trouble for both our … 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 do I configure Qt for cross-compilation from Linux to Windows target?

Just use M cross environment (MXE). It takes the pain out of the whole process: Get it: $ git clone https://github.com/mxe/mxe.git Install build dependencies Build Qt for Windows, its dependencies, and the cross-build tools; this will take about an hour on a fast machine with decent internet access; the download is about 500MB: $ cd … Read more

Cross-compile a Rust application from Linux to Windows

Other answers, while technically correct, are more difficult than they need to be. There’s no need to use rustc (in fact it’s discouraged, just use cargo), you only need rustup, cargo and your distribution’s mingw-w64. Add the target (you can also change this for whatever target you’re cross compiling for): rustup target add x86_64-pc-windows-gnu You … Read more

How to stop MinGW and MSYS from mangling path names given at the command line

There is a way to suppress the path translation by setting MSYS_NO_PATHCONV=1 in Windows Git MSys or MSYS2_ARG_CONV_EXCL=”*” in MSYS2. Alternatively, you can set the variable only temporarily just for that command by putting the assignment just before the command itself: MSYS_NO_PATHCONV=1 arm-none-linux-gnueabi-gcc.exe -Wall -g \ -Wl,–dynamic-linker=/usr/lib/myrpath/ld-linux.so.3 \ -Wl,-rpath=/usr/lib/myrpath \ -I../targetsysroot/usr/include \ myprogram.c -o myprogram

How to build x86 and/or x64 on Windows from command line with CMAKE?

This cannot be done with CMake. You have to generate two separate build folders. One for the x86 NMake build and one for the x64 NMake build. You cannot generate a single Visual Studio project covering both architectures with CMake, either. To build Visual Studio projects from the command line for both 32-bit and 64-bit … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)