6

I'm taking a class in which I'm required to write some C++ apps for Linux. I really, really dislike the dev tools available under Linux, but I love VS2010.

Is there any sort of compiler switch which will enforce ANSI or gcc compatibility in VC++? Or can I swap the compiler out for gcc and still use the VS environment?

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
3Dave
  • 28,657
  • 18
  • 88
  • 151
  • The VS Project Team blog suggests that with VS2010 it may be possible to use GCC directly with VS - http://blogs.msdn.com/b/vsproject/archive/2009/06/10/platform-extensibility-part-1.aspx – Chris Oldwood May 17 '11 at 22:01

2 Answers2

9

You can disable Microsoft extensions to the ANSI C and ANSI C++ standards by specifying the /Za flag, which will make the compiler emit errors if you use non-standard C and C++ features.

http://msdn.microsoft.com/en-us/library/0k0w269d(v=VS.100).aspx

However, this doesn't preclude you from using platform specific headers.

wkl
  • 77,184
  • 16
  • 165
  • 176
3

This blog post seems to discuss something similar to what you're after.

I can't seem to find better info than this MSDN document regarding VS2010 ANSI compatibility.

Some alternatives to VS2010 include MonoDevelop - which supports C#, VB.Net, C/C++.

There's also Eclipse IDE for C/C++ Dev.

This stackoverflow question may also be of use.

Community
  • 1
  • 1
cofiem
  • 1,384
  • 1
  • 17
  • 29
  • 2
    Thanks for the links. I'm not looking for an alternate IDE to use - just a good way to use VS and gcc together. So far I've been testing as I go by recompiling in gcc. – 3Dave Feb 20 '11 at 21:45