How do I make Windows run Linux executables?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I compiled a C++ program under Linux:
make -f mymakefile
This will generate an executable, a.out
. It seems this executable cannot be run in the Windows command prompt.
linux windows
add a comment |Â
up vote
3
down vote
favorite
I compiled a C++ program under Linux:
make -f mymakefile
This will generate an executable, a.out
. It seems this executable cannot be run in the Windows command prompt.
linux windows
without ever doing this id think you would have to use a cross compiler
– Hayden Thring
7 hours ago
1
Since it's a C++ program, why don't you consider compiling and delivering the executable on a windows machine separately?
– Raju Devidas
7 hours ago
1
Can you explain what the C++ program does? If it's a command line program, then it would probably work if recompiled under the correct compiler on Windows (I presume GCC, but depends on the code). If it uses a GUI, then maybe it could compile on Windows, but maybe not. If it's some sort of daemon or device driver, then almost definitely, it won't compile on Windows.
– Neil
53 mins ago
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I compiled a C++ program under Linux:
make -f mymakefile
This will generate an executable, a.out
. It seems this executable cannot be run in the Windows command prompt.
linux windows
I compiled a C++ program under Linux:
make -f mymakefile
This will generate an executable, a.out
. It seems this executable cannot be run in the Windows command prompt.
linux windows
linux windows
edited 6 mins ago
Peter Mortensen
8,227166184
8,227166184
asked 7 hours ago
Terry Qiao
2013
2013
without ever doing this id think you would have to use a cross compiler
– Hayden Thring
7 hours ago
1
Since it's a C++ program, why don't you consider compiling and delivering the executable on a windows machine separately?
– Raju Devidas
7 hours ago
1
Can you explain what the C++ program does? If it's a command line program, then it would probably work if recompiled under the correct compiler on Windows (I presume GCC, but depends on the code). If it uses a GUI, then maybe it could compile on Windows, but maybe not. If it's some sort of daemon or device driver, then almost definitely, it won't compile on Windows.
– Neil
53 mins ago
add a comment |Â
without ever doing this id think you would have to use a cross compiler
– Hayden Thring
7 hours ago
1
Since it's a C++ program, why don't you consider compiling and delivering the executable on a windows machine separately?
– Raju Devidas
7 hours ago
1
Can you explain what the C++ program does? If it's a command line program, then it would probably work if recompiled under the correct compiler on Windows (I presume GCC, but depends on the code). If it uses a GUI, then maybe it could compile on Windows, but maybe not. If it's some sort of daemon or device driver, then almost definitely, it won't compile on Windows.
– Neil
53 mins ago
without ever doing this id think you would have to use a cross compiler
– Hayden Thring
7 hours ago
without ever doing this id think you would have to use a cross compiler
– Hayden Thring
7 hours ago
1
1
Since it's a C++ program, why don't you consider compiling and delivering the executable on a windows machine separately?
– Raju Devidas
7 hours ago
Since it's a C++ program, why don't you consider compiling and delivering the executable on a windows machine separately?
– Raju Devidas
7 hours ago
1
1
Can you explain what the C++ program does? If it's a command line program, then it would probably work if recompiled under the correct compiler on Windows (I presume GCC, but depends on the code). If it uses a GUI, then maybe it could compile on Windows, but maybe not. If it's some sort of daemon or device driver, then almost definitely, it won't compile on Windows.
– Neil
53 mins ago
Can you explain what the C++ program does? If it's a command line program, then it would probably work if recompiled under the correct compiler on Windows (I presume GCC, but depends on the code). If it uses a GUI, then maybe it could compile on Windows, but maybe not. If it's some sort of daemon or device driver, then almost definitely, it won't compile on Windows.
– Neil
53 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
13
down vote
You cannot natively run a program for Linux under Windows. They are completely different operating systems.
However, there are methods you can try to run the program:
- Recompile the program on Windows to get a native executable
- Install the Windows Subsystem for Linux and run the program in that environment
- Install Linux in a virtual machine and run the program in that environment
- Install Cygwin or MinGW and recompile and run in that environment
- Use a cross compiler
Granted, depending on the nature of the program and its dependencies, it might not be possible to run in another environment without modifications to the source code, or at all.
1
Depending on how you look at it, running under WSL is "native" under Windows, though not pre-installed by default.
– Bob
22 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
13
down vote
You cannot natively run a program for Linux under Windows. They are completely different operating systems.
However, there are methods you can try to run the program:
- Recompile the program on Windows to get a native executable
- Install the Windows Subsystem for Linux and run the program in that environment
- Install Linux in a virtual machine and run the program in that environment
- Install Cygwin or MinGW and recompile and run in that environment
- Use a cross compiler
Granted, depending on the nature of the program and its dependencies, it might not be possible to run in another environment without modifications to the source code, or at all.
1
Depending on how you look at it, running under WSL is "native" under Windows, though not pre-installed by default.
– Bob
22 mins ago
add a comment |Â
up vote
13
down vote
You cannot natively run a program for Linux under Windows. They are completely different operating systems.
However, there are methods you can try to run the program:
- Recompile the program on Windows to get a native executable
- Install the Windows Subsystem for Linux and run the program in that environment
- Install Linux in a virtual machine and run the program in that environment
- Install Cygwin or MinGW and recompile and run in that environment
- Use a cross compiler
Granted, depending on the nature of the program and its dependencies, it might not be possible to run in another environment without modifications to the source code, or at all.
1
Depending on how you look at it, running under WSL is "native" under Windows, though not pre-installed by default.
– Bob
22 mins ago
add a comment |Â
up vote
13
down vote
up vote
13
down vote
You cannot natively run a program for Linux under Windows. They are completely different operating systems.
However, there are methods you can try to run the program:
- Recompile the program on Windows to get a native executable
- Install the Windows Subsystem for Linux and run the program in that environment
- Install Linux in a virtual machine and run the program in that environment
- Install Cygwin or MinGW and recompile and run in that environment
- Use a cross compiler
Granted, depending on the nature of the program and its dependencies, it might not be possible to run in another environment without modifications to the source code, or at all.
You cannot natively run a program for Linux under Windows. They are completely different operating systems.
However, there are methods you can try to run the program:
- Recompile the program on Windows to get a native executable
- Install the Windows Subsystem for Linux and run the program in that environment
- Install Linux in a virtual machine and run the program in that environment
- Install Cygwin or MinGW and recompile and run in that environment
- Use a cross compiler
Granted, depending on the nature of the program and its dependencies, it might not be possible to run in another environment without modifications to the source code, or at all.
edited 22 mins ago
Bob
42.9k19131166
42.9k19131166
answered 7 hours ago
Keltari
46.5k16108157
46.5k16108157
1
Depending on how you look at it, running under WSL is "native" under Windows, though not pre-installed by default.
– Bob
22 mins ago
add a comment |Â
1
Depending on how you look at it, running under WSL is "native" under Windows, though not pre-installed by default.
– Bob
22 mins ago
1
1
Depending on how you look at it, running under WSL is "native" under Windows, though not pre-installed by default.
– Bob
22 mins ago
Depending on how you look at it, running under WSL is "native" under Windows, though not pre-installed by default.
– Bob
22 mins ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1361051%2fhow-do-i-make-windows-run-linux-executables%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
without ever doing this id think you would have to use a cross compiler
– Hayden Thring
7 hours ago
1
Since it's a C++ program, why don't you consider compiling and delivering the executable on a windows machine separately?
– Raju Devidas
7 hours ago
1
Can you explain what the C++ program does? If it's a command line program, then it would probably work if recompiled under the correct compiler on Windows (I presume GCC, but depends on the code). If it uses a GUI, then maybe it could compile on Windows, but maybe not. If it's some sort of daemon or device driver, then almost definitely, it won't compile on Windows.
– Neil
53 mins ago