VC++ .NET 2003 specific compiler symbol to identify the compiler.

G

Guest

I am developing a product , that I would like to compile
in different development environments.

So if I have to include any header file
specific to VC++ 2003 implementation, I would
like to put them in a guard something like -

#ifdef <VC++.NET 2003 specific symbol here>
#include <customerheader1.h>
#endif

Can anyone let me know what is the symbol that we use for
identify VC++ .NET 2003 implementation.

I used the symbol - ' __VISUALC__ '. That does not seem to help.

Thanks for letting me know.
 
C

Carl Daniel [VC++ MVP]

Karthik said:
I am developing a product , that I would like to compile
in different development environments.

So if I have to include any header file
specific to VC++ 2003 implementation, I would
like to put them in a guard something like -

#ifdef <VC++.NET 2003 specific symbol here>
#include <customerheader1.h>
#endif

Can anyone let me know what is the symbol that we use for
identify VC++ .NET 2003 implementation.

I used the symbol - ' __VISUALC__ '. That does not seem to help.

The symbole is _MSC_VER, and it's defined for all versions of Visual C++.
The value depends on the version you're compiling with.

For VC6 it will be 1200
For VC7 it will be 1300
For VC7.1 it will be 1310
For VC8 it will be 1400

So you want to write something line

#if defined(_MSC_VER) && (_MSC_VER >= 1310)
#include <special header file>
#endif

HTH

-cd
 
J

Jochen Kalmbach

I am developing a product , that I would like to compile
The symbole is _MSC_VER, and it's defined for all versions of Visual
C++. The value depends on the version you're compiling with.

For VC6 it will be 1200
For VC7 it will be 1300
For VC7.1 it will be 1310
For VC8 it will be 1400

For older values of _MSC_VER see:

INFO: Predefined Identifiers in Microsoft C and C++
http://support.microsoft.com/kb/q65472/


You should also be aware of the fact that some other compilers also define
_MSC_VER (like Intel).

See: Why does Intel C++ Compiler define _MSC_VER?
http://softwareforums.intel.com/ids/board/message?board.id=16&message.id=
1811

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top