Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
masterneko opened this issue Sep 8, 2020 · 1 comment
Open

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

masterneko opened this issue Sep 8, 2020 · 1 comment

Comments

@masterneko
Copy link

masterneko commented Sep 8, 2020

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
@tonisives
Copy link

i specified the actualt image id:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants