I've been assigned to do a certain project for a programming competition and it is stated on their website that they will test programs using the gcc 3.3.4 compiler. So, what I'm wondering is would it be safe for me to use Visual C++ for the project but refrain from using .NET conveniences (namely create a native Win32 application)? I could download one of the tools they provide but I'm much more used to the environment of Visual Studio. What do you guys think?
Asked
Active
Viewed 111 times
1
-
2The answer is "probably"... but since you already know how your work will be assessed, don't you think it behooves you to test in the same environment to be certain? There _are_ subtle differences in how compilers do their jobs so even if you mainly work in VC++, do your grade a favor and verify under gcc before turning your work in. – mah Jan 14 '14 at 12:15
-
Oh well, I guess I will have to deal with it then. – Dimitris Iliadis Jan 14 '14 at 12:18
-
3What platform do they use for testing this thing? gcc 3.3.4 is ancient, any reason why they would use such an old compiler? – pentadecagon Jan 14 '14 at 12:25
-
Really? Ha, I don't know why they'd be doing that. They will use Linux (doesn't specify what edition). – Dimitris Iliadis Jan 14 '14 at 12:37
-
1I think GCC 3.3 is comparable to VS2001 or something of that vintage. Certainly VS2012 is far too modern and allows many C++11 features that GCC didn't support back in the stone age. – MSalters Jan 14 '14 at 12:42
-
@MSalters Just to clarify (in case the OP misunderstands you) - that isn't a problem as long as he sticks to whatever C++ standard the older GCC version supports, and doesn't use any newer features or compiler specific features. – JBentley Jan 14 '14 at 14:24
1 Answers
6
No matter what you do, test your code with gcc
before submitting it. Apart from that, its hard to answer your question. There definitely are differences between MSVC++ and gcc. Whether these differences are important depends on your habits and the kind of assignment. Depending on these factors, you may have to put a lot of efforts into porting your code from MSVC++ to gcc
. Or you may not.
Personally, I would prefer to use the compiler that my program is going to be tested with.

Markus Mayr
- 4,038
- 1
- 20
- 42
-
That's what I thought. Anyway, one more thing, would it be possible for me to use the Visual C++ IDE (to have IntelliSense and all other features) but compile using gcc? – Dimitris Iliadis Jan 14 '14 at 12:19
-
You can, but it again depends on if you have used standard C. Also, MSVC supports C89 only, where as GCC supports C99 and above.. – Aniket Inge Jan 14 '14 at 12:20
-
There's no requirement to compile through MSVC. That is... you can use that tool as an editor (benefiting from IntelliSense), along with performing manual compilation externally. Just keep in mind that doing this, IntelliSense uses VC's header files, not gcc's, unless you've taken efforts to address that (though it's unlikely to be an issue). – mah Jan 14 '14 at 12:22
-
-
@JimIliadis The short answer is yes and if this is just a one-off it's probably easier to do just that. If you're interested in being able to do this longer term, you may want to have Visual Studio use GCC directly to do it's compiling, in which case have a look at [this question](http://stackoverflow.com/questions/216025/gcc-with-visual-studio). – JBentley Jan 14 '14 at 14:21