Converting from Visual C++

Hi there - as a long time Visual C++ dev I’ve grown increasingly frustrated with its lack of cross-platform support and someone suggested I should look at Clang. My first encounter was with a product called “C++ Builder” (by Embarcadero) though AFAICT its not a compiler in its own right. It’s more of an intelligent IDE which wraps around Clang.

So this got me wondering if Clang already has its own IDE? Or if there are others I should look at too (Eclipse maybe - or Code::Blocks?) If I do make the move to Clang I’d have over 90 x VC++ projects to convert. So an IDE which can import (or convert) from VC++ project files would be particularly interesting. Any suggestions gratefully received!!

John

Why not Visual Studio itself?

https://devblogs.microsoft.com/cppblog/clang-llvm-support-in-visual-studio/

Michael

Thanks Michael, that's an interesting link. My main reason for moving away from Visual Studio has been its lack of cross-platform support. So I'm assuming that if I combined Visual Studio with Clang, I still wouldn't get cross-platform compilation (or am I wrong about that??)

The article implies that Visual Studio does currently compile for both Windows & Linux (presumably both on the Windows platform?) but there's no mention of OS-X.

John

It's important to be grok the distinction between the *compiler*
(Visual C++) and the *editor* (IDE), Visual Studio. If you just want
to continue to develop on Windows, for Windows, using Visual Studio but
using clang instead of Visual C++ _as your compiler_, then you can do
so.

It's not clear what you mean by "cross-platform compilation". Do you
mean, you want to develop code and compile it natively (or in a virtual
machine etc.) on different operating systems while using the same IDE
across them all? That is cross-platform development.

Or do you want to work on a single operating system (e.g., Windows) and
compile your code so that it runs on different platforms? That is
cross-compiling.

If you want cross-platform development you'll have to find an IDE that
works on all the platforms you want. There are plenty of them but
Visual Studio is not one of them.

There is Visual Studio Code (not Visual Studio) which is an open-source
IDE from Microsoft that runs on all platforms including Windows, MacOS,
and GNU/Linux.

Or you can choose from a number of other IDEs, both free and not free,
which are available on multiple platforms.

If you're heavily invested in Visual Studio (using project files, etc.)
then it will take you some effort to extract yourself and start using
cross-platform tools. That's the disadvantage of vendor lock-in. I
recommend that you look at using cmake to generate your project files,
for example. However I'm not aware of any facility that will
automatically convert Visual Studio project files into cmake files so
you will have to do that work by hand.

Here's a post that describes some of the different Visual IDEs; this
may be outdated in details but is still mostly true as far as I'm
aware:

https://stackoverflow.com/a/33798601/939557

Thanks Paul - at the moment I'm mostly on a fact finding mission. I've spent many years developing with Visual C++ but I'd grown tired of it not offering cross-platform development (not even cross-compiling). So it's been good to hear that it now supports clang. In the past I've also experimented with cmake for a couple of projects and found it pretty good.

The big problem (here) is that I have over 90 projects all currently saved as VC++ projects - so I've been looking for a way to either utilise them somehow or to find some tool that'd help me with conversion. But the good news is that (in addition to supporting clang via cmake) Visual Studio now also supports it using VC++ projects directly:-

https://docs.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=vs-2019

If you want cross-platform development you'll have to find an IDE that
works on all the platforms you want. There are plenty of them but
Visual Studio is not one of them.

There is Visual Studio Code (not Visual Studio) which is an open-source
IDE from Microsoft that runs on all platforms including Windows, MacOS,
and GNU/Linux.

Actually, I believe the Visual Studio IDE is now available for all 3 platforms. I think it's still quite limited though.... last time I checked, it was only supporting 3 of Microsoft's own languages:- Visual Basic, C# and F# (whatever that is...)

Here's a post that describes some of the different Visual IDEs; this
may be outdated in details but is still mostly true as far as I'm
aware:

https://stackoverflow.com/a/33798601/939557

That looks like a good link. I'll read through it later and many thanks.

John

Thanks Michael and Paul for helping with this.

I've spent a few days experimenting with Visual Studio + Clang and on Windows at least, I'm finding they really work quite seamlessly together. Does anyone happen to know if there's a dedicated forum anywhere (or mailing list) for people interested in VS+Clang development? I'd like to find out some more detailed stuff that's specific to the Visual Studio side of things (for example, can the same VS project be used for both a Windows build and also a Linux build)?

John

On the clang&llvm part there is cfe-users

https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

I´m not awere of any forum devoted to just VS+linux tought.