Martin Ba
Martin Ba

Reputation: 38775

Using Visual C++ with a different C++ compiler?

I like the Visual Studio IDE. I'm used to it and find it is the best IDE I've ever tried. We also find increasing use of C#/.NET here.

However, after the underwhelming announcement regarding C++11 features in VS11 I'm looking into replacing the compiler.

It seems that the Intel compiler fully integrates with VS but that doesn't mean it will compile our Windows code. I don't know how I'd fare with a try of g++ or clang

Can VS actually be productively used with a different C++ compiler to compile Windows code, that is legacy code using all kinds of Win32 / MFC / COM stuff?

Upvotes: 3

Views: 811

Answers (3)

Vicky
Vicky

Reputation: 13244

I use Visual Studio 2008 with a Makefile project to cross-compile; no reason you couldn't do the same with a different Windows compiler.

Upvotes: 0

ChrisV
ChrisV

Reputation: 3423

Depends on how much use you made of the Microsoft-proprietary extensions. Things like #pragma once tend to be supported by all the major compilers, but the weirder COM things (e.g., #import and anything C++/CLI) probably won't be. No idea if MFC will build under the new compiler, but you'll probably have to link it statically or ship your own DLL; G++ definitely uses a different mangling scheme than MSVC.

I'm not sure how easy it is to replace cl.exe and keep your vcproj files intact (though some compilers actually do it), but there are always Makefile projects.

Upvotes: 1

Nemanja Trifunovic
Nemanja Trifunovic

Reputation: 24561

I have never actually worked with the Intel C++ compiler, but I see no reason why it wouldn't compile the code that VC++ does. Here is official Intel documentation.

Upvotes: 0

Related Questions