Questions tagged [cross-compiling]
For general cross compiling issues, where a separate 'hosting' environment is used to build for the 'target' platform.
cross-compiling
4,587
questions
227
votes
10
answers
252k
views
Missing include "bits/c++config.h" when cross compiling 64 bit program on 32 bit in Ubuntu
I am running the 32bit version of Ubuntu 10.10 and trying to cross compile to a 64 bit target. Based on my research, I have installed the g++-multilib package.
The program is a very simple hello ...
193
votes
13
answers
263k
views
Error "gnu/stubs-32.h: No such file or directory" while compiling Nachos source code
I am trying to install Nachos on my laptop and I have Ubuntu 11.04 on the laptop.
The code is in C and so to build it I assume I will need cross compiler. This is where my problem is. I downloaded ...
164
votes
8
answers
168k
views
Cross compile Go on OSX?
I am trying to cross-compile a go app on OSX to build binaries for windows and linux. I have read everything what I could find on the net. Closest example that I have found has been published on (...
135
votes
5
answers
115k
views
Undefined reference to a static member [duplicate]
I'm using a cross compiler. My code is:
class WindowsTimer{
public:
WindowsTimer(){
_frequency.QuadPart = 0ull;
}
private:
static LARGE_INTEGER _frequency;
};
I get the following error:
...
135
votes
2
answers
88k
views
What's the difference of "./configure" option "--build", "--host" and "--target"?
The script ./configure accepts 3 options --build, --host and --target. I'm confusing their roles. What's the difference and semantics of them?
126
votes
9
answers
173k
views
How to install the Raspberry Pi cross compiler on my Linux host machine?
I am attempting to get cross-compiling for Raspberry Pi working on my Ubuntu machine.
During my initial attempts I was using the arm-linux-gnueabi compiler, which is available in the Ubuntu repo. I ...
120
votes
6
answers
106k
views
Cross-compile a Rust application from Linux to Windows
Basically I'm trying to compile the simplest code to Windows while I am developing on Linux.
fn main() {
println!("Hello, and bye.")
}
I found these commands by searching the internet:
rustc --...
116
votes
3
answers
173k
views
How to build x86 and/or x64 on Windows from command line with CMAKE?
One way to get cmake to build x86 on Windows with Visual Studio is like so:
Start Visual Studio Command prompt for x86
Run cmake: cmake -G "NMake Makefiles" \path_to_source\
nmake
One way to get ...
108
votes
6
answers
45k
views
How to stop MinGW and MSYS from mangling path names given at the command line
On Windows, I'm cross-compiling a program for ARM/Linux using CodeSourcery's cross-compiler suite. I use MinGW MSYS as my command interpreter, and very often it will mangle my paths and pathnames. For ...
90
votes
5
answers
102k
views
How do I configure Qt for cross-compilation from Linux to Windows target?
I want to cross compile the Qt libraries (and eventually my application) for a Windows x86_64 target using a Linux x86_64 host machine. I feel like I am close, but I may have a fundamental ...
87
votes
10
answers
98k
views
How to Compile for OS X in Linux or Windows?
I would like to port my C/C++ apps to OS X.
I don't have a Mac, but I have Linux and Windows. Is there any tool for this?
82
votes
3
answers
79k
views
All possible GOOS value?
If I get it right, GOOS is determined when compile the source code.
To better support multiple OS, I'm interested in what GOOS could be.
Of course, there might be infinite possibilities of it, since ...
81
votes
6
answers
146k
views
CMake: The C Compiler is not able to compile a simple test program [duplicate]
I am trying to cross-compile the Azure IoT SDK C for a Mips processor. Cross-compiling an older version of the same SDK using an older version of CMake (2.8.12.2) works just fine, so I doubt it's the ...
76
votes
10
answers
161k
views
Hunk #1 FAILED at 1. What's that mean?
I get the following error when running make, and I have no idea what it means or what to do about it. Can anyone illuminate me or point me in the right direction?
(cd libdvdnav-git && patch -...
70
votes
6
answers
61k
views
How to write code in Java 11, but target Java 8 and above?
I am working on a small library and for obvious reasons I would like to write code using all the Java 11 features (except modules I guess for now), but I would like the library to be compatible with ...
68
votes
5
answers
41k
views
what is cross compilation?
what is cross compilation?
66
votes
8
answers
82k
views
How to list library dependencies of a non-native binary?
When developing for native platform, I can use ldd to list all the shared libraries (.so files) a binary executable I build will try to load upon start-up. But when cross-compiling, I don't know how ...
60
votes
3
answers
159k
views
How to compile dts Linux device tree source files to dtb?
I have a device tree file (.dts) and I want to compile the file for my powerpc based board.
How can I do it on my machine, which is not powerpc based?? Can I do it with the DTC installed on my Ubuntu ...
59
votes
6
answers
36k
views
cross compiler ldd
I have created a cross compiled arm executable. I want to find the library dependency of the executable. I am using ubuntu natty and installed arm-linux-gnueabi tool chain, which does not contain ldd. ...
56
votes
2
answers
115k
views
cmake : Set environment variables from a script
I have a script that sets all variables needed for the cross-compilation. Here is just part of it :
export CONFIG_SITE=~/workspace/eldk-5.4/powerpc/site-config-powerpc-linux
export CC="powerpc-linux-...
55
votes
2
answers
71k
views
When using CGO_ENABLED is must and what happens
Question
Please help understand when CGO_ENABLED is must and unavoidable, and what happens with the go compilation process.
When CGO_ENABLED is must
After having read the articles in references, it ...
54
votes
5
answers
80k
views
C++ cross-compiler from Windows to Linux [closed]
Are there any user friendly tools out there to cross-compile from Windows to Linux?
53
votes
7
answers
51k
views
Is there an alternative to HTML? [closed]
Is there a language I can use to write my website's HTML, which:
converts to HTML without having to write the HTML directly
has all the power of HTML
is less verbose than HTML and XML
For example, ...
52
votes
2
answers
13k
views
Can anyone explain the gcc cross-compiler naming convention?
I have tried to understand the naming conventions behind the gcc cross-compilers, but there seems to be conflicting answers. I have the following three cross-compilers in my system:
arm-none-linux-...
51
votes
8
answers
52k
views
Cross-compilation for Raspberry Pi in GCC. Where to start?
TL/DR: Where can I find more information about building a GCC 4.7.0 cross-compiling toolchain for ARM (gnueabi) platform (intended to run on a Raspberry Pi device)?
I have just got a brand new ...
50
votes
5
answers
120k
views
How to cross compile from Windows to Linux?
I've installed Go 1.2 on a Windows machine, wrote up a dummy program and set the environment variables GOARCH and GOOS to "AMD64" and "linux" respectively.
When i issue the "go build" command, i ...
50
votes
1
answer
4k
views
How to build an OCaml cross compiler
After finding a way to generate the fitting configuration files for the target machine, the cross compiler itself must still be built. The approach using the 1 1/2 build described here (and, with more ...
49
votes
5
answers
65k
views
ffmpeg for a android (using tutorial: "ffmpeg and Android.mk")
I am trying to compile ffmpeg for a android. I have found several posts on this theme but non of these seems to work. If tried to build ffmpeg like it is posted on [1]. Did anybody successfully ...
48
votes
9
answers
36k
views
Embed resources (eg, shader code; images) into executable/library with CMake
I am writing an application in C++ which relies on various resources in my project. Right now, I have the relative path from the produced executable to each resource hard-coded in my sources, and that ...
46
votes
4
answers
64k
views
Tool to analyze size of ELF sections and symbol
I need a way to analyze output file of my GCC compiler for ARM. I am compiling for bare metal and I am quite concerned with size. I can use arm-none-eabi-objdump provided by the cross-compiler but ...
46
votes
2
answers
94k
views
CMake: specifying build toolchain
Very new to CMake, and so far I'm finding it to be extremely helpful. I have a set of custom libraries that I would like to build for multiple platforms using cross-compilation. The toolchains are ...
43
votes
5
answers
50k
views
Can I skip cmake compiler tests or avoid "error: unrecognized option '-rdynamic'"
compilation options for cmake (on windows) for ARM target system but when I run configure it's starting compiler tests:
CMake Error at D:/Program Files/CMake 2.8/share/cmake-2.8/Modules/...
43
votes
3
answers
38k
views
Manual for cross-compiling a C++ application from Linux to Windows?
Is there a manual for cross-compiling a C++ application from Linux to Windows?
Just that. I would like some information (links, reference, examples...) to guide me to do that.
I don't even know if ...
39
votes
1
answer
27k
views
What is a toolchain and a cross compiler? [closed]
I have had confusion over this terminology for a long time. I have tried to google this question and have been getting some contradictory answers.
One site says cross compiler is the same as a tool ...
39
votes
6
answers
62k
views
Cross compiling static C hello world for Android using arm-linux-gnueabi-gcc
I want to build a static hello world from C using arm-linux-gnueabi-gcc as opposed to using the NDK standalone toolchain or Codesourcery for that matter.
In Ubuntu...
I have done the following:
...
39
votes
2
answers
2k
views
Having LLVM IR library how to crosscompile it to iOS, Android, Windows and Mac from Ubuntu?
I have representations of all my dependencies and my library in LLVM IR forms. How to cross-compile my library into a shared object for iOS, Android, Windows and Mac platforms from Linux ( Ubuntu for ...
38
votes
5
answers
56k
views
How to work with external libraries when cross compiling?
I am writing some code for raspberry pi ARM target on x86 ubuntu machine. I am using the gcc-linaro-armhf toolchain. I am able to cross compile and run some independent programs on pi. Now, I want to ...
34
votes
4
answers
69k
views
How do I invoke the MinGW cross-compiler on Linux?
I have a project that I want to cross-compile for Windows. I have the appropriate Makefile and everything works with g++. I've run
$ apt install mingw-w64
and downloaded 500 MB of packages, but I ...
33
votes
2
answers
44k
views
Golang: How to cross compile on Linux for Windows
How do I cross compile a Go project on Linux to generate an executable for running on Windows?
33
votes
6
answers
88k
views
Cross compiling a kernel module
I'm trying to cross compile a helloworld kernel (2.6.x) module for ARM architecture on my intel x86 host.
The codesourcery tool chain for ARM is located at: /home/ravi/workspace/hawk/arm-2009q3
The ...
33
votes
5
answers
89k
views
Cross compiler prefix and path in eclipse
I'm trying to create a C++ project on eclipse. I have installed eclipse-cdt for that.
While creating a project, a pop up window asks for cross compiler prefix and cross compiler path. Could someone ...
32
votes
6
answers
78k
views
How to set Architecture for docker build to arm64?
I have a Dockerfile that I run on amd64 but want to run on arm64. Since go build tool takes GOARCH=arm64 as argument I don't need any other cross compilation tool to make the binary.
# Run the build
...
32
votes
9
answers
50k
views
C++ cross platform compiling
I'm using Windows 7 - 32bit operating system.
I want to compile my simple C++ source code into executable for all OSes and architectures.
I want to compile for this below operating systems from my ...
32
votes
5
answers
43k
views
How to cross compile for linux x86 with linux amd64, cmake and g++?
+1 for each piece of information that helps to complete the whole picture. You don't need to know the whole answer. I'll appreciate individual pieces of the puzzle just as much. Thanks.
I am about to ...
32
votes
2
answers
4k
views
Cross compiling FreeTDS to iPhone
Since this question is unanswered and I spent the majority of a semester figuring it I thought I would post how to Cross compiling FreeTDS 0.91 to iPhone ARMv6, ARMv7 architecture. This was done ...
32
votes
2
answers
4k
views
How do I use custom assembler for clang?
I've compiled clang to use it as a cross compiler for ARM (by configuring it with ./configure --target=armv7l-unknown-linux-gnueabihf ), but when I try to compile any C code, it tries to use /usr/bin/...
30
votes
4
answers
10k
views
Clojure iOS Development
Over the past months, I've pretty much fallen in love with Clojure and refuse to use anything else.
I am aware that there is ClojureScript, which uses Google Closure to compile a subset of Clojure to ...
29
votes
2
answers
15k
views
pkg-config error during Rust cross-compilation
I am getting this error when I try to cross-compile some Rust; does anyone know what I should be doing?
This happens when I run cargo build --target aarch64, I get:
Compiling glib-sys v0.10.1
error: ...
28
votes
4
answers
11k
views
Compiling Scala before / alongside Java with Gradle
The default scala plugin task flow compiles Java before Scala so importing Scala sources within Java causes "error: cannot find symbol".
27
votes
2
answers
19k
views
CMake cross-compiling: C flags from toolchain file ignored
I use cmake for cross compiling. In my toolchain file there is a line
SET(CMAKE_C_FLAGS "-std=gnu99")
This variable is not set in CMakeLists.txt again.
When I run cmake -DCMAKE_TOOLCHAIN_FILE=...