Makefiles for Microsoft Visual C++ - visual-c++

I have few queries regarding makefiles for MSVC. I want to create makefiles which will compile my project on Visual C++ compiler. One thing I found in the web named "nmake" which is said to be the makefiles for MSVC(correct me if I am wrong).
So, I introduced myself with nmake and compiled a single source file successfully with this. But the issue is, I need to run this nmake file using command prompt of visual studio. I haven't found a way to use the file in normal command prompt. Is it really possible?
Suppose, I don't have a visual studio installed. I have only the visual C++ compiler. Then how I will be able to compile my projects using nmake?
One Additional question, if I have only visual C++ compiler installed(like the old compilers eg. microsoft visual C++ 2005), then is it certain that I will get nmake command on this?
Thanks in advance.

Solved! Answering myself, so that if anyone intend to compile makefiles using nmake for Visual C++ compiler.
Yes, it is compiles in older version of visual C++ also. I have tested and it works fine. But it may cause problems when some properties are use of latest visual C++ compiler. Because you will not find those properties in older version of C++ compiler. Otherwise it is quite OK.

Related

CMake to create a Visual Studio Code project

Does any know if there are any efforts for cmake to generate a Visual Studio Code project (not to be confused with Visual Studio)? IE
cmake -G "Eclipse CDT4 - Unix Makefiles"
not for eclipse, but for Visual Studio Code? This would be awesome for linux projects.
As already mentioned, VS Code has the vscode-cmake-tools extension to integrate with CMake projects.
See here for documentation on what features it has to offer. You will see that building and debugging within the IDE are supported.
The design of VS Code is very much centered around being simple and extensible, whereas Visual Studio is more of a monolith and includes its own build system for C++. VS Code is not monolithic like that.

Can I use Visual Studio for developing Linux C or C++?

I have to develop something in Linux(CentOS 6.5) Environment using C or C++ language with many of libraries for linux.
As you know, CentOS is not GUI. So, I want to use Microsoft Visual Studio for my work. It's OK even if use just VS as the Editor.
I mean that I like the features of IDE visual studio(intellisense, debugger, and so on).
I have Visual Studio 2008, 2010, 2013 Professional.
yes you can, in fact, if you have setup a VM machine, you can even directly include the C++ include library of Linux (However, this only works for write code, not work with compiling). You could also setup CYGWIN or MINGW for referencing the header of Linux platform.
In fact, for myself, I switched to QtCreator as a cross platform C++ IDE, it also has auto-complete and debug features.

Use Clang with MSVC 2010

First of all, I want to ask if Clang compiler is better than MSVC's default compiler? And how can I use Clang with MSVC? For example, I write code in MSVC then when I hit Build, it call Clang to build the project.
https://github.com/ishani/ClangVSx
AddIn for Visual Studio 2010 that allows use of the Clang C/C++ compiler in place of MSVC++. Translates VC project and build settings into gcc-friendly command line arguments, along with existing platform tools (MSVC Linker, Librarian, RC) to complete the build chain.
Using clang compiler on Windows is still considered to be in experimental state. However, some progress has been made recently. As I answered similar question:
LLVM provides Windows snapshot builds - a clang toolset for Visual Studio as Windows installer. Currently it should integrate with Visual Studio 2010, 2012 and 2013. More information can be found on LLVM's blog post A path forward for an LLVM toolchain on Windows.
You can use a "makefile project" to have Visual Studio invoke a makefile (or any command-line process) when you tell it to build.
I've done this before to get MSVC's nice source navigation for non-Windows embedded projects.
The drawback is that you have to manually keep the makefile in sync with the files in the project (or vice-versa depending on how you want to look at it) - generally not a huge problem.

porting MSVS proj files to makefiles?

Does anyone know if/how to automatically generate makefiles from a .sln/.vcproj files of a C++ application in MSVS to be used to compile and build this application on Linux ?
Thanks, --Yariv
You can create a makefile from within Visual Studio. It's not exactly the same thing as in Linux, but the numner of required modifications is not too big.
MSDN: Creating a Makefile Project

Error highlighting in Visual C++

When using Eclipse or NetBeans IDE on a Java project I get to see where errors in my code are, before and after compiling. The line causing the issue is shown. I remember that back in the old days, the Visual C++ 98' edition did do underlining of errors in the code. Is there a way to enable this in Visual C++ 2005? Or is there a 3rd party plugin to do so?
What you need in order to do this is a static code analysis tool for C++ with a real-time plug-in for VS2005. Unfortunately, I'm not aware of any open-source static code analyzers that plug into VS2005, but there are some commercial ones. One such product that has been well-received is Riverblade's Visual Lint.
In general, Googling "visual c++ static code analysis" is a good place to start hunting this type of software down.
Visual Assist is also a useful tool. Works with all versions of visual studio.

Resources