Linked Questions
21 questions linked to/from How to Detect if I'm Compiling Code with a particular Visual Studio version?
0 votes
1 answer
124 views
Conditional compiling in source code [duplicate]
I need to use strncpy_s in my code. The code needs to be compiled using msvc71 as well as msvc90 compilers. It turns out that strncpy_s is not supported in msvc71. I have implemented my own version of ...
112 votes
9 answers
114k views
How do I check for C++11 support?
Is there a way to detect at compile-time if the compiler supports certain features of C++11? For example, something like this: #ifndef VARIADIC_TEMPLATES_SUPPORTED #error "Your compiler doesn't ...
38 votes
2 answers
18k views
Which C99 features are available in the MS Visual Studio compiler?
It's well known that Microsoft's Visual Studio compiler does not support C99, and it looks like they have no plans to support it. However, the compiler does include some cherry picked features such as ...
30 votes
2 answers
47k views
What is this #ifdef __GNUC__ about?
I've found these lines in the libmagic code. What do they mean? #ifdef __GNUC__ __attribute__((unused)) #endif What does __GNUC__ mean? It seems to check whether GCC is installed. What is ...
10 votes
4 answers
8k views
Using TR1 libraries in GCC and MSVC
I would like to use the TR1 libraries that ship with modern versions of GCC and MSVC, but there are subtle differences: in GCC, I have to say #include <tr1/memory> std::tr1::shared_ptr<int&...
2 votes
1 answer
8k views
__cplusplus is equal to 199711 in MSVC, does it support C++11? [duplicate]
I want to know if my compiler supports C++11 or no, and when use the const __cplusplus to know the C++ version, I found that prints 199711. Is this version number means that compiler supports C++11? ...
1 vote
2 answers
13k views
Need more explanation on LNK2038 mismatch dectected for '_MSC_VER'
I inherited an old program from a colleague that is no longer with the company. It's an CPLEX optimization we use. It was built in house in C++ using Visual Studio 2005 and CPLEX121. The server where ...
9 votes
1 answer
5k views
c++11/14 make_unique ambigious overload for std::string
Could someone please explain how to resolve the ambigious overload warning for make_unique, where the error comes from and what it does exactly mean (I do understand what an ambigious overload is but ...
6 votes
2 answers
3k views
error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CImportProjectDlg::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'
I am converting a VC++6.0 project to Visual Studio 2008 (enroute to 2014). I am encountering the above error. Here is my code snippet: BEGIN_MESSAGE_MAP(CImportProjectDlg, CDialog) //{{AFX_MSG_MAP(...
2 votes
2 answers
8k views
How to learn a version of MSVC compiler of the MS Visual Studio 2022 installed from IDE?
I have Microsoft Visual Studio 2022 installed and when I open from IDE the menu item Help->About Microsoft Visual Studio it shows Version 17.7.7 (explicitly saying "Current" for my ...
9 votes
2 answers
6k views
Detecting compiler versions during compile time
This is both a question and a reference and I am hoping that people can build upon this so that it can be reused by people with similar questions. How can we reliably detect a particular version of a ...
3 votes
3 answers
301 views
Is there a way to fix format specifiers warnings for stdint types?
The problem is that on one platform (windows, mvsc2015) uint64_t is defined as unsigned long long and on another (ubuntu, clang) it's unsigned long and there is the code which looks like sprintf(...
3 votes
2 answers
4k views
Error: hash_map does not name a type
I am receiving an error message for not naming a type, as follows: error: ‘hash_map’ does not name a type typedef hash_map<const char*,LexUnitX*,MLexUnitFunctions> MLexUnit; The code in ...
1 vote
2 answers
3k views
How to install lxml on Windows 8 64-bit with Python 3.4
Related Question 1 Related Question 2 [Error Log] C:\Users\Hima\Documents\Installers\python\packages>python -m pip install lxml-3.4.4-cp34-none-win_amd64.whl lxml-3.4.4-cp34-none-win_amd64.whl is ...
3 votes
2 answers
2k views
Visual studio #if on visual studio version
I want to compile different thing based on the visual studio version i'm using, something like #if VISUAL_STUDIO_VERSION > 2015 eventH?.Invoke(this, EventArgs.Empty); #else if(eventH != null) ...