How do I make Windows run Linux executables?

The name of the pictureThe name of the pictureThe name of the pictureClash 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.










share|improve this question























  • 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














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.










share|improve this question























  • 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












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.










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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
















  • 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










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:



  1. Recompile the program on Windows to get a native executable

  2. Install the Windows Subsystem for Linux and run the program in that environment

  3. Install Linux in a virtual machine and run the program in that environment

  4. Install Cygwin or MinGW and recompile and run in that environment

  5. 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.






share|improve this answer


















  • 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










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "3"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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






























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:



  1. Recompile the program on Windows to get a native executable

  2. Install the Windows Subsystem for Linux and run the program in that environment

  3. Install Linux in a virtual machine and run the program in that environment

  4. Install Cygwin or MinGW and recompile and run in that environment

  5. 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.






share|improve this answer


















  • 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














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:



  1. Recompile the program on Windows to get a native executable

  2. Install the Windows Subsystem for Linux and run the program in that environment

  3. Install Linux in a virtual machine and run the program in that environment

  4. Install Cygwin or MinGW and recompile and run in that environment

  5. 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.






share|improve this answer


















  • 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












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:



  1. Recompile the program on Windows to get a native executable

  2. Install the Windows Subsystem for Linux and run the program in that environment

  3. Install Linux in a virtual machine and run the program in that environment

  4. Install Cygwin or MinGW and recompile and run in that environment

  5. 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.






share|improve this answer














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:



  1. Recompile the program on Windows to get a native executable

  2. Install the Windows Subsystem for Linux and run the program in that environment

  3. Install Linux in a virtual machine and run the program in that environment

  4. Install Cygwin or MinGW and recompile and run in that environment

  5. 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.







share|improve this answer














share|improve this answer



share|improve this answer








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












  • 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

















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

List of Gilmore Girls characters

Confectionery