I wanted to figure out how to tell if my code was compiling in Visual Studio or somewhere else (GCC probably), and I found that you can use #ifdef _MSC_VER.
Tag Archives: visual studio
Enabling Windows SDK 7.1 in Visual Studio 2008
I was having a problem where Visual Studio was saying that “windows.h” could not be found after having installed the Windows SDK v7.1. I found this article which said to update the path in “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\CurrentInstallFolder” in the registry. So I did that, and now everything is working.
Fatal error LNK1120: unresolved externals, caused by C functions in C++
I was receiving link error LNK1120 in Visual Studio after adding some C code to my C++ project, and the problem was, as I discovered here (and found more info on here), that I hadn’t declared my C code as “extern C”.
So basically I added #ifdef __cplusplus macros to check if it was C or C++ code and if C++ then outputting “extern C {” with a suitable “}” at the end of the file.
Windows SDK 7.1
I followed these instructions from Mozilla to download the latest version of the Windows SDK which is installing as we speak. I didn’t install the .NET Framework Version 4, I hope that doesn’t create a problem for me.
dirent.h
I’m doing some Linux C++ programming, and I’m doing the dev work on Windows, so I figured I’d have a go at compiling in Visual Studio (I’m running VS2008). One problem I had was that there was no dirent.h header file, but I found one.