Описание тега undefined-reference
A linker error caused by a missing definition of a symbol used elsewhere in a program
The most common causes are
- Declaring but not defining a function, global variable or static data member
- Not compiling or linking to an object file that contains the definition of a symbol
- Forgetting to link to the library that provides the symbol
- Listing a required library before the objects that depend on it (in the linker command libraries should be listed after the objects that depend on them)
There is a C++ FAQ question about undefined references in C++ and how to solve them.