I have 64bit ubuntu virtual machine and a 64bit binary still getting the Exec format error.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
$ uname -a
Linux shrikant-VirtualBox 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ file ../Mingw_instatllation/bin/x86_64-w64-mingw32-g++
../Mingw_instatllation/bin/x86_64-w64-mingw32-g++: Mach-O 64-bit x86_64 executable
$ ../Mingw_instatllation/bin/x86_64-w64-mingw32-g++ test.cpp
bash: ../Mingw_instatllation/bin/x86_64-w64-mingw32-g++: cannot execute binary file: Exec format error
Can someone either point me to a good mingw tool chain or give suggestion to solve this issue?