Run c++ exe in linux

Last Edited By Krjb Donovan
Last Updated: Mar 11, 2014 07:52 PM GMT

QuestionEdit

QUESTION: Dear Sir,

 I have a c++ exe file which successfully run on windows machine. Now i want to reuse the code which i have to run form linux. Is there anyway to convert exe to linux runnable format? I tried wine but itshows some error. Or is there any wayt to find the code of the exe?

Thanking you, Umaimath

ANSWER: There is no good way to get the source code from the executable file, and even if it could be done, it may be of no use - there might be call to the windows api (win32) functions which won't be there in linux at all.

Unfortunately, wine does not run all windows programs. There are a few other good (sadly non-free) alternatives. see: http://www.computerworld.com/s/article/69849/Windows_Emulators_for_Linux_VMware_Win4Lin_Face_Off


---------- FOLLOW-UP ----------

QUESTION: Thank you very much for your reply sir. Could you please explain how to create linux executable of c++ program? It contains more than one c++ source code and header files.

Thanking you, Umaimath

AnswerEdit

g++ is the "GNU C++ compiler", which is standard with linux. For the basics of hoe to compile and build programs, see: http://pages.cs.wisc.edu/~beechung/ref/gcc-intro.html

If you have a large number of source files, using a Makefile is recommended. For the basics of creating and using Makefiles, see: http://linuxgazette.net/issue83/heriyanto.html

Advertisement

©2024 eLuminary LLC. All rights reserved.