Welcome to 16892 Developer Community-Open, Learning,Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

So I have to decide where a program that I like to write will run. it means three things

  1. Run on same OS and processor type (developed in Linux on x86-64) used the same setup for development

No question to ask

  1. Make program in Linux x86-64 and compile it to mobile phone running android (ARM instruction set requirement because what I know is android is arm based) -- so different OS and different instruction sets of compiled-to program requirement

Question how to do it. If not using any IDE. Just want to relay on makefile -- Then what I need to install on my Linux Development Machine so what I compile my C/C++/Python code with make and produce android arm program?

  1. Make program in Linux x86-64 and run on Windows on x86-64 machine. Question: What I will need

Also is there any compiler or emulator for development in Linux and compiling on Linux but getting produced program for Raspberry Pi.

I just want some of available options if I am developing and compiling on Linux x86-64 computer . I like opensource options. Name and few words of explanation


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.8k views
Welcome To Ask or Share your Answers For Others

1 Answer

Make program in Linux x86-64 and compile it to mobile phone running android (ARM instruction set requirement because what I know is android is arm based) -- so different OS and different instruction sets of compiled-to program requirement

And a different libc. You not just have to cross compile like for example from x86_64 desktop linux for AArch64 desktop linux, you have to link against Bionic Libc.

For this you can use the NDK from android. For a makefile, you could for example use:

CC=aarch64-linux-android30-clang make target (You have to change linked and ar tool and so on)

Make program in Linux x86-64 and run on Windows on x86-64 machine. Question: What I will need

Use for example mingw. For debian-like, I use this packages: mingw-w64-x86-64-dev, gcc-mingw-w64, gcc-mingw-w64-x86-64-posix, gcc-mingw-w64-x86-64-posix, gcc-mingw-w64-x86-64-win32-runtime, gcc-mingw-w64-x86-64-win32 (Some may be redundant)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to 16892 Developer Community-Open, Learning and Share
...