views:

63

answers:

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?

Thanks

+2  A: 

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.

Chris S
+3  A: 

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?

MStodd
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