I was going back through Principles and Programming by Stroustrup and after completing the chapter 6 exercise I was left with these weird linker errors with very unhelpful messages (to me). Does anyone know what's wrong here?
/* error LNK2019: unresolved external symbol "public: __thiscall Token_stream::Token_stream(void)" (??0Token_stream@@QAE@XZ) referenced in function "void __cdecl `dynamic initializer for 'ts''(void)" (??__Ets@@YAXXZ) */
The error message is saying that you never defined the body for the Token_stream class' constructor. It looks like you don't really need a constructor for the class any way so you could just use a default constructor.
1 2 3 4 5 6
class Token_stream
{
public:
Token_stream(); // try removing or commenting out this line and see if that fixes things
void putback(Token t);
Token get();