There are a variety of C++ compilers available. The purpose of this document is to highlight a few of the major differences between Microsoft's Visual C++ compiler, and the compiler on the CS Department's computer, Hercules.
Check with your class instructor to see what is required for your class. For example, in CS170, you can use C++ compilers other than the one located on Hercules, but ultimately your programs must run on Hercules. i.e. You are responsible for any conversion.
First of all, C++ is C++. You don't have to change your code in order for it to compile on either compiler. Some little things may need to change (like Visual C++ allows you to leave the .h off the included files), but C++ is C++.
The biggest difference between the compilers is the interface. Visual C++ puts all your files within a click's reach, it uses windows for everything. Hercules compilers are all command line, which means that you work one file at a time and have to type in everything you wish to do. Depending on your experience, only you can decide which is easier to work with. Most people are familiar with the windows environment. With Hercules you need to use editing programs such as vi and pico. These can be difficult to work with because you need to know a bunch of keystrokes to preform even simple task. For instance, in vi you need to type 'i' inorder to be able to start typing in words. .
When compiling unperfect code (we've all done it) the compiler usually tells us of erronious lines in our code. The Hercules compilers always give the filename and the line number. The Hercules compiler DCC even indicates where on the line the error is. Visual C++ also gives the filename and line number. There is a special window for all the errors. When you double click the error message, Visual C++ takes you to that line. It doesn't point to where on the line though.
Next comes the debuggers. For those of you who are unsure, a debugger is a program that can go step by step through your code. This is useful when you are trying to find out where an error is occuring that's not a syntax error. Though both compiler platforms has a debugger, they are quite different.
The dubugger on Hercules is DBX. Like everything else, you use commands to go through your code. It takes a while to understand all that you see, but eventually you can get the hang of it.
Visual C++'s build in debugger is quicker to learn. It takes you step by step through your program files and the error messages are easier to understand. This debugger can also go through the assembly code of your program, just incase you go for that.
Visual C++ is harder to get started. It creates programs using projects and workspaces. Once you get past this hurdle, you are well on your way. Hercules sortof does the same thing with Makefiles. You can set up a makefile which will compile all your programs and combine them into one executable. This a very useful feature for both compilers because it saves time by only recompiling the object files that need to be recompiled.
This page has been accessed times.
Last modified: Sunday, 25-Mar-2012 17:23:41 CST
Copyright 2000 Department of Computer Science, University of Regina.