Author

Topic: What is the best distro to compile windows binaries? (Read 249 times)

hero member
Activity: 1220
Merit: 612
OGRaccoon
This might be what your looking  working in debian

 Wink
Code:

sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git

Then choose:

-------------------------------------------------
Option A: Cross-compile Windows wallets (64 bit)
-------------------------------------------------

sudo apt-get install g++-mingw-w64-x86-64 mingw-w64-x86-64-dev

# Pick posix version for the following!

sudo update-alternatives --config x86_64-w64-mingw32-gcc
sudo update-alternatives --config x86_64-w64-mingw32-g++

cd depends

make -j 24 HOST=x86_64-w64-mingw32

# *** TIME FOR A REST HERE THIS TAKES SOME TIME ***

cd ..

./autogen.sh

CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/

make -j 24

Optional: strip the binaries to reduce size at this point if you're going to share them.

-------------------------------------------------
Option B: Compile native Linux wallets
-------------------------------------------------

cd depends

make -j 24

# *** ANOTHER PLEASE WAIT MOMENT OR TWO ***

cd ..

./autogen.sh

CONFIG_SITE=$PWD/depends/x86_64-pc-linux-gnu/share/config.site ./configure --prefix=/

make -j 24

Optional: strip the binaries to reduce size at this point if you're going to share them.
legendary
Activity: 1372
Merit: 1252
Why not just run it (or compile it) on a virtual Windows machine?

I've never made use of it myself, but AFAIK Microsoft overs free time-limited images for virtual machine set ups. For example here's a bunch of Windows 7 images primarily used for IE testing, but they should support other basic Windows functionalities as well:
https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/

I trust Linux live environment better than Windows VM. If your Windows machine was compromised, then the compiled code could be compromised. Why not minimize this risk by using a Live boot.

Bitcoin Core provides fairly detailed step by step instructions for cross compiling for Windows using Ubuntu: https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md#cross-compilation-for-ubuntu-and-windows-subsystem-for-linux. It would probably be the easiest and least buggy for you to use Ubuntu and just follow those instructions.

The only dependency that is really required is MinGW. All other dependencies are built by the depends system.

Thanks. I will try to download later "Ubuntu Bionic 18.04" specifically, not sure if its the latest, I guess so. I will boot from a live USB. Get the exe and save it somewhere.
staff
Activity: 3458
Merit: 6793
Just writing some code
Bitcoin Core provides fairly detailed step by step instructions for cross compiling for Windows using Ubuntu: https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md#cross-compilation-for-ubuntu-and-windows-subsystem-for-linux. It would probably be the easiest and least buggy for you to use Ubuntu and just follow those instructions.

The only dependency that is really required is MinGW. All other dependencies are built by the depends system.
legendary
Activity: 3346
Merit: 3130
I want to compile the executable for windows on linux, it's a fork of Core of some altcoin, there's no way im installing altcoin stuff without compiling the source code. Which is the distro that will have all the libraries needed to build the binaries?

Will this work in the latest Ubuntu?

Code:
sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.

then get the .git and:

Code:
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
cd depends
make HOST=x86_64-w64-mingw32
cd ..
./autogen.sh # not required when building from tarball
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
make

The last time i did this was like 10 years ago.

I write code on C++ and then compile it as .exe, and the tool i used what the same you mention (Mingw), the code was something like:

Code:
i586-mingw32msvc-g++ -o myApp.exe myApp.cpp

If you want to learn more about this topic you should google about cross compiling, i will leave a couple of sources for you  Wink

http://forums.codeblocks.org/index.php?topic=3343.0
https://stackoverflow.com/questions/2033997/how-to-compile-for-windows-on-linux-with-gcc-g
legendary
Activity: 3122
Merit: 2178
Playgram - The Telegram Casino
Why not just run it (or compile it) on a virtual Windows machine?

I've never made use of it myself, but AFAIK Microsoft overs free time-limited images for virtual machine set ups. For example here's a bunch of Windows 7 images primarily used for IE testing, but they should support other basic Windows functionalities as well:
https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
legendary
Activity: 1372
Merit: 1252
I want to compile the executable for windows on linux, it's a fork of Core of some altcoin, there's no way im installing altcoin stuff without compiling the source code. Which is the distro that will have all the libraries needed to build the binaries?

Will this work in the latest Ubuntu?

Code:
sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.

then get the .git and:

Code:
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
cd depends
make HOST=x86_64-w64-mingw32
cd ..
./autogen.sh # not required when building from tarball
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
make
Jump to: