Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2004

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Karthik - 14 Oct 2004 00:39 GMT
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.
Carl Daniel [VC++ MVP] - 14 Oct 2004 01:44 GMT
> I am developing a product , that I would like to compile
> in different development environments.
[quoted text clipped - 11 lines]
>
>  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
Jochen Kalmbach - 14 Oct 2004 06:42 GMT
>> I am developing a product , that I would like to compile
>> in different development environments.
[quoted text clipped - 6 lines]
> 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

Signature

Greetings
 Jochen

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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.