C++ - Trouble Shooting

Last Updated: 2022-02-05

undefined reference to

Most likely your .cc file does not match .h. Make sure all methods declared in .h have definitions in .cc, the signature must match.

has virtual functions but non-virtual destructor

Mark your destrutor virtual:

virtual ~Foo();

"candidate function not viable: expects an rvalue for 1st argument"

Instead of passing the value v directly, pass std::move(v)

Error: Segment Fault / heap-use-after-free

Probabally you used a pointer after std:move.