I plan to write application in C using Microsoft Visual Studio 2012. The problem is that I can't find a way to compile it right in the editor. I found this solution http://msdn.microsoft.com/en-us/library/bb384838.aspx but I dont like it. Can you recommend me a way to compile C program right in the Visual Studio 2012?
The Visual Studio build tools include a C compiler that you can use to create everything from basic console programs to full Windows Desktop applications, mobile apps, and more.
C/C++ support for Visual Studio Code is provided by a Microsoft C/C++ extension to enable cross-platform C and C++ development on Windows, Linux, and macOS.
All C++ compilers also support C linkage, for some compatible C compiler. When you need to access a function compiled with C linkage (for example, a function compiled by the C compiler, or a function written in assembler), declare the function to have C linkage.
CMake, Clang, mingw, and more Use MSBuild with the Microsoft Visual C++ compiler or a 3rd party toolset like CMake with Clang or mingw to build and debug your code right in the IDE.
It is a little bit tricky to compile plain C90 and C++x0 (only partially supported) projects in VS2010 (and probably Visual Studio 11, I haven't tried native development in it yet).
What you have to do is to create a new C++ project without precompiled header -- this is the primary requirement if you want to compile a platform-independent code (library, console application).
There are several ways to do it. One way is to create a normal Win32 C++ console application, in the opened wizard you should go to the second page (by clicking "Next") and then uncheck the option "Include precompiled header". Then you can compile C++ (and C) projects directly in VS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With