You are here:

C++/Run c++ exe in Linux

Advertisement


Question
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_



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

Answer
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  

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


vijayan

Expertise

my primary areas of interest are generic and template metaprogramming, STL, algorithms, design patterns and c++09. i would not answer questions about gui and web programming.

Experience

over 15 years

Education/Credentials
post graduate engineer

©2012 About.com, a part of The New York Times Company. All rights reserved.