When I compile my code for a linked list, I get a bunch of undefined reference errors. The code is below. I have been compiling with both of these statements:
Another way to get this error is by accidentally writing the definition of something in an anonymous namespace:
foo.h:
namespace foo { void bar(); }
foo.cc:
namespace foo { namespace { // wrong void bar() { cout << "hello"; }; } }
other.cc file:
#include "foo.h" void baz() { foo::bar(); }