Which test-coverge tool for Microsoft Visual Studio Compiler? - c++

The main product of our organization has been developed(and being developed) in C/C++ over the past 10 years. The compiler used is Microsoft Visual Studio (cl) for the same.
We need a test-coverage tool (identical to gcov) for checking the coverage of the code. As per my understanding, gcov only works with g++ family of compilers and hence will not work with Visual Studio's compiler. (please correct me if I'm wrong).
Now, since we can't change the compiler; please suggest a test-coverage tool which will work in our case.
Thanks.

Related

How to enable the "C++ Compiler" option in Microsoft Visual Studio to set up the C++ compiler to be g++?

I know the question "how to use g++ in VS" has been asked several times in a variety of ways, and I have read through many posts, but only one solution seemed feasible to my team and I given the requirements we have and the limited time we have to figure this out. That solution would be the one in this link: How to use GCC with Microsoft Visual Studio? (the second answer) which shows how to set up the c++ compiler to be g++ using the Microsoft Visual Studio's GUI.
Our problem is that not any of us see that option in our respective GUIs. We even tried with the latest version of Visual Studio 2019 and we keep not seeing it. So, my question now is: how to enable the "C++ Compiler" option in Visual Studio so that I can then use g++ to be that compiler?

Code Analysis Not Available in This Edition of the Compiler

I'm trying to run code analysis for the first time on my native C++ application. I'm developing using Visual Studio 2013 Ultimate and compiling using the Visual C++ Compiler Nov 2013 CTP (CTP_Nov2013), which is the latest (I believe) compiler from MS for C++11. When trying to run Code Analysis I receive the following warning:
warning D9040: ignoring option '/analyze'; Code Analysis warnings are not available in this edition of the compiler
So I'm wondering if it's because I'm using this new compiler that it's not able to run code analysis or what. But I couldn't find any answers by briefly Googling. The MSDN for Visual Studio says code analysis works for all version of VS except Express. Any help would be appreciated, and if it's a "No it doesn't work with that compiler" then that's fine. Just wondering. Thanks!
It seems to work only for x86 builds. If you're doing an x64 build, it won't be available.

Using different compiler in Visual Studio

This maybe a beginner question but could not find proper answer on the internet.
I am curious can I use some other compiler (which I like) in Visual Studio 10?
As of Visual Studio 2010, it is conceptually possible to integrate another compiler. In the book ‘Inside the Microsoft Build Engine, Using MSBuild and Team Foundation Buid’ 2nd edition, on page 338, the chapter ‘Adding a New Platform and Platform Toolset’ the process of adding gcc to visual studio is explained.
However, while it is possible, it has always remained as a concept. To my awareness, nobody has actually been up to the task and publicly disclosed the results. But even with this support, you'd still be lacking debugging facilities. Which would require your compiler of choice to generate .pdb files and/or extend visual studio with a new local debugger
In summary it's quite a venture
You can use other compiler Intel c++ in VS. I don't think any other compiler supports VS.The main reason behind it is lack of plug-ins in VS. But you can use cmake scripts to compile your code in different compilers. With eclipse you can use most of the compilers (VS,gcc). Code blocks also allows you to choose the compilers.
Yes,you can use Intel C++,and even MATLAB 7.1 or later for sure..here is a reference to use MATLABIt gives a step by step procedure to use MATLAB with VS
You can also write Java programs and include javac compiler for it...you can refer this if needed..Including javac with VS
I kno this is surely possible from VS 2010 but not sure for the b4 editions..hope it helps..

Compiler used by Visual Studio for C++?

I have tried searching on the internet but could not find out the compiler used by Visual Studio for C++ applications.
I wanted to know whether it is freely available & whether it can be used for commercial applications.
Traditionally I have been using Turbo C++.
The problem with Visual Studio C++ Express is that it does not work with some applications.
For example, BRL-CAD which is an open source project works properly with the commercial version but gives some problems for the Express edition.
It seems that there is some problem with MinGW compiler as well.
I am told this by the people running that project.
Visual Studio uses the same compiler for all editions. So, the Express edition uses the same compiler as the Professional edition. There are also no restrictions on producing commercial applications, in either case. There are differences in the advanced features offered by the IDE, but the compilers are the same. So whatever your problems are in getting the project to work, it is nothing to do with the compiler.

I need to change compiler on VS

I have made a sudoku solver using SDL (for GUI) on VCpp 2010 IDE.
The program compiles without errors and runs fine. However, i cannot pass the compiled executable on to some people because they don't have msvc dll on their pc.
I thought i could use devc++ that compiles with GCC but this IDE is kinda buggy and just won't let me include some header files.I also have some problems setting up SDL expansions.
So, is there a way to change VisualStudio compiler to GCC?
I really need to stay with VS because it is easy to use and there is a lot of online support.
Short answer: no, you cannot change cl.exe (MS cc compiler) with gcc. Or mingw. (You can with a compatible compiler, like Intel C compiler)
Long answer: you don't need to to that. Use the static linked runtime library, and you don't have a dependency ms dlls anymore (see this answer: How do I make a fully statically linked .exe with Visual Studio Express 2005?)
Or redistribute the VC++ runtime with your app. It's free (http://www.microsoft.com/en-us/download/details.aspx?id=26999)
You don't need to change compiler - they need to download the Visual Studio 2010 redistributable:
http://www.microsoft.com/en-gb/download/details.aspx?id=5555
In short: no. You can't simply use the GCC compiler in Visual Studio.
The long version: you can use a Makefile project to run GCC, but then you lose some of the benefits of using Visual Studio.
I'm not sure when this became a feature in Visual Studio (probably wasn't one in 2013), but it is now possible to change the "Platform Toolset" - and thus the compiler - used by Visual Studio to other compilers like Clang/LLVM and GCC. I have been happily using Clang with VS2017 ever since the MSVC++ compiler bugged up with some 3rd party libraries.
Microsoft made a blog post on the installation instructions and how to switch.