Joke Errors:
WCOMPREND: The spelling, grammar, or terminology of your signal has fallen to the point that it severely degrades MaulingMonkey's ability to comprehend it. Failure to improve the signal quality may result in being misinterpreted, any resulting damages cannot be held as the responsibilty of MaulingMonkey (c)(tm)(Inc.).
ECOMPREND: The spelling, grammar, or terminology of your signal has fallen to the point that it terminally degrades MaulingMonkey's ability to comprehend it. Failure to improve the signal quality may result in being clarity of your posts has fallen beyond my ability to comprend it.
Linker Errors
Unresolved symbols
(MSVC) error LNK2019: unresolved external symbol "__A__" (__B__) referenced in function __C__
(GNU) /usr/bin/ld: Undefined symbols:
__A__
__A__
__A__
Simple enough: this means that you try to use A (of mangled name B) in C, but the linker can't find it. Common causes include:
- Mislinked (if the function/variable belongs to a given library)
- Forgot to link against the library that implements it
- Built the library with a different calling convention than the one used in your program
- Misimplemented (if the function/variable belongs to you)
- Forgot to implement the function ("void foo();" without a "void foo() { … }")
- Forgot to implement the variable ("extern int var;" without a "int var;" (in 1 source file))
- Typeoed the name (remember, C++ is case sensitive)
- Implemented in the wrong scope ("::Foo" instead of "::Baz::Bar::Foo", for example)
- Misdeclared & Used (rare, requires multiple screwups)
- Typeoed the name ("void Foo(); void user() { Foo(); }", when the function is implemented as "void foo() { … }")
- Declared in the wrong scope ("::Foo" instead of "::Baz::Bar::Foo", for example)
- Macro Interference
- The function name is #defined in an API header to something else, and inconsistently #included in the using and defining code
- Biggest offender to check: The Win32 API. See if your function name turns up a hit in The MSDN if you're using CamelCase, or #define NOMINMAX first if trying to use the non-macro min/max es
- Second biggest offender (IMO :P): The Ruby API (if writing Ruby extensions). Redefines a lot of standard C library function names, including those reused in the C++ standard library, causing many problems. See libindustry's industry/languages/ruby/detail/wrap_retarded_ruby.hpp for that.
Multiply defined symbols
(MSVC) error LNK2005: "__A__" (__B__) already defined in __C__
Simple enough: The definition/implementation of A (of mangled name B) has been found in multiple places — wherever this error occured, as well as in C. Common causes include:
- Forgot to mark a function to be inlined as inline
- Forgot to mark a global variable decleration as extern
Compiler Errors
std::string operator confusion
(MSVC) error C2678: binary '==' : no operator found which takes a left-hand operand of type 'const std::string' (or there is no acceptable conversion)
guiddef.h(192): could be 'int operator ==(const GUID &,const GUID &)'
(MSVC) error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'const std::string' (or there is no acceptable conversion)
guiddef.h(197): could be 'int operator !=(const GUID &,const GUID &)'
These are typically caused by a missing #include <string>. Other headers you've included provide the declaration for std::string (allowing you to create references to them without error), but not the definition of std::string and it's operators (hence your compiler's confusion). Including the header will provide all the missing definitions.