digitalmars.D.learn - Is it possible to make an Linux Executable Binary using a Windows
- 00004 (15/15) Jul 24 2023 Could someone share a step by step way to compile and link a
- Guillaume Piolat (11/26) Jul 25 2023 1. Download LDC for Linux x86-64 and LDC for Windows
- Kagamin (1/1) Jul 27 2023 You will also need crt1.o, crti.o, crtn.o and libc.a
Could someone share a step by step way to compile and link a x86-64 Linux Binary using Windows 10? (Without virtual machine or "Linux Subsystem for Windows") I want to compile and link a Hello World program for both Linux and Windows. **example.d** ``` import std.stdio; void main() { writeln("Hello, World!"); } ``` So I need `.exe` binary for windows and a runnable linux binary for linux.
Jul 24 2023
On Monday, 24 July 2023 at 11:57:11 UTC, 00004 wrote:Could someone share a step by step way to compile and link a x86-64 Linux Binary using Windows 10? (Without virtual machine or "Linux Subsystem for Windows") I want to compile and link a Hello World program for both Linux and Windows. **example.d** ``` import std.stdio; void main() { writeln("Hello, World!"); } ``` So I need `.exe` binary for windows and a runnable linux binary for linux.1. Download LDC for Linux x86-64 and LDC for Windows 2. In your LDC that you want to use as cross-compiler, edit etc/ldc2.conf to add the triple entry from the other LDC, for linux cross-compiler support 3. Copy the pre-compiles libraries from the Linux LDC so that they are accessible from your cross-compiler. 4. Use DUB with the right triple eg. $ dub -a x86_64-something-linux If DUB finds your cross-compiler, it will pass the triple to -mtriple.
Jul 25 2023