2
  • I got a source for console program written in c++ for linux
  • Is there a (automated) way to compile this source to run in windows? and what about linux functions and libraries called in this file?

2 Answers 2

5

It depends on the source, but if it's using linux functions and libraries, installing Linux might end up being easier that getting it to compile in Windows.

Cygwin is one option. MinGW is another option.

How much code are we talking, and what libs does it look like it's using?

1
  • 2
    If it is compatible, MinGW is the better option. Cygwin adds an extra emulation layer that slows lots of things down, and causes compatibility issues between cygwin-compiled apps and native-compiled apps. The downside is that MinGW is not 100% compatible with Linux code, so some changes may be needed. But if it's just a simple console program that does file input/output, then it may work just ifne.
    – davr
    Mar 29, 2010 at 18:49
2

You'll probably want to install Cygwin. It adds Unix/Linux-like functionality to Windows and includes a repository of typical Linux programs, like GCC, which will probably be able to compile your code. You'll still need to learn some basic shell commands, like how to run "make" to compile the code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.