Research Article

On Compiler Error Messages: What They Say and What They Mean

Table 4

Error messages of four different C++ compilers for Errors 5–7.

Compiler Message for Error 5

g++ In method ‘SavingAccount::SavingAccount()’:
declaration of ‘float SavingAccount::getInterestRate()’
outside of class is not definition

MinGW In constructor ‘SavingAccount::SavingAccount()’:
expected primary-expression before “float”
expected ‘;’ before “float”

MVC++ error C2601: ‘getInterestRate’: local function definitions are illegal
fatal error C1004: unexpected end of file found

BC++ E2089 Identifier ‘getInterestRate’ cannot have a type qualifier
(plus 3 more lines)

Compiler Message for Error 6

g++ tmp ccf2R75s.o: In function ‘Figure::Figure(int)’:
tmp ccf2R75s.o(.text+0x9): undefined reference to ‘Figure virtual table’

MinGW C: Temp ccqwbaaa.o(.text _ZN6FigureC2Ei[Figure::Figure(int) +0x8)
In function ‘ZSt17__verify_groupingPKcjRKSs’:
[Linker error] undefined reference to ‘vtable for Figure’

MVC++ error6.obj: error LNK2001: unresolved external symbol “public:
virtual float__thiscall Figure::Perimeter(void)” (?Perimeter@Figure@@UAEMXZ)
Debug error6.exe: fatal error LNK1120: 1 unresolved externals

BC++ [Linker Error] Unresolved external ‘Figure::Perimeter()’ referenced
from C: DOCUMENTS AND SETTINGS ERROR6.OBJ

Compiler Message for Error 7

g++ parse error before,

MinGW In constructor ‘SavingsAccount::SavingsAccount(std::string, std::string, Date, float)’:
expected primary-expression before “owner”
expected primary-expression before “idNum”
expected primary-expression before “openDate”

MVC++ error C2144: syntax error: missing ‘)’ before type ‘string’
error C2612: trailing ‘#’ illegal in base/member initializer list
error C2512: ‘BankAccount’: no appropriate default constructor available
error C2082: redefinition of formal parameter ‘owner’
error C2146: syntax error: missing ‘;’ before identifier ‘idNum’
(plus 4 more lines)

BC++E2108 Improper use of typedef ‘string’
E2312 ‘string’ is not an unambiguous base class of ‘SavingsAccount’
E2312 ‘Date’ is not an unambiguous base class of ‘SavingsAccount’
E2251 Cannot find default constructor to initialize base class ‘BankAccount’