Are you having a GCC/G++ Compiler Error?
If you answered YES!!!!! Then you have found the right place. This page
is
constantly growing page. It is meant to be a resource for CS students
at
Spelman College to help them figure out compiler errors when no help
can
be found.
Errors and Warnings?
The G++ compiler produces both warnings and errors. There is a reason
for these two types of diagnostics:
Errors: These messages are problems that make it
impossible for you to
compile your program. They are reported giving you
both the file name where
the error was found and the line number of the error:
SourceFile.cc:17: - indicates the error is on line #17 of the
file called SourceFile
Warnings: These messages indicated some unusual condition in your code.
It is possible that it may cause an actual error(in
your case it will most likely
cause an error). The compilation process will
usually continue until an
error is uncovered. Warning message look
just like error messages, but will
have the word warning at the beginning of the message:
SourceFile.cc:17: warning - indicates a warning on line #17 of
the file called SourceFile
If you give the compiler the -Wall or -W
option then it will provide all warnings.
Otherwise, only the more harmful warnings are
displayed.
When should you use this page?
You should use this page as a first resort when you can not figure out
what a compiler error message means. If you still can't figure it out,
then this document may help you understand the response you get
from a peer, the TA, or your professor.
How to use this page?
Well for now(in the future in my copious spare time this may be
more sophisticated), you have to do the following:
Which error message is yours?
Listing of Compiler Error Explanations
(NOTE:
This listing only contains
the beginning of the error message)
Compiler
Error Messages(Parsing, Type Checking, etc.)
Linker Error Messages(Final
stage of the compilation process)
Somefile:#:
(each undeclared identifier is reported only once Somefile:#:
for
each function it appears in.)
The following group of messages all begin with:
In file included from somefile.cc:#: somefile.h:#:
all of this stuff basically means
that the file that is giving you problems was #included
in the file somefile.h which was #included in the file somefile.cc.(sometimes
this is
useful information)