crossbuild icon indicating copy to clipboard operation
crossbuild copied to clipboard

./a.out: cannot execute binary file: Exec format error

Open masterneko opened this issue 5 years ago • 1 comments

Makefile:

all: main.cpp
    @gcc -xc++ -lstdc++ -shared-libgcc main.cpp
    @echo Finished macOS compile

main.cpp:

#include <iostream>

int main()
{
    std::cout << "Hello world" << std::endl;
    return 0;
}
$ docker run -it --rm -v $(pwd):/workdir -e CROSS_TRIPLE=x86_64-apple-darwin  multiarch/crossbuild bash
$ make
Finished macOS compile
$ ./a.out
bash: ./a.out: cannot execute binary file: Exec format error

masterneko avatar Sep 08 '20 05:09 masterneko

i specified the actualt image id:

docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=windows 846ea4d99d1a make helloworld

tonisives avatar Feb 03 '21 07:02 tonisives