views:

79

answers:

2

Hi,

Assume I have source code for a lib/tool that works on gcc compiler. Can I use the same code and compile it in visual studio. will that be possible at all? If it is possible, how do I do it?

A: 

if you are just using all the standard C/C++ library like stdio.h, stdlib.h, etc. it should work fine. Pure console program should work fine. If you used some GUI related library (especially if you are porting over from unix to window) then it might not work.

To do so, you can simply just create a new project in visual studio and add the existing source code into the project workspace. Compile it, if you encounter any error, just post here or try solve if you know how

calculus1985
Thnk. I have few libraries for polytope model frameworks that use gcc. can i use them directly in visual studio ?
cuda-dev
A: 

It depends on your code, GCC support a variant of C (C99) which Visual Studio doesn't support yet.
If your trying to compile a Unix program on Windows you best bet will be to use Cygwin.
Check this question for pointers on using Cygwin in Visual Studio.

Shay Erlichmen
GCC supports many languages, such as C99, FORTRAN and C++. Visual Studio supports another set. C++ is the most important labguage they sahre.
MSalters