views:

281

answers:

2

Don't be too hard on me! Simply put:

foo.h:

#include "bar.h"
class foo {
private:
    bar it;
    void DoIt();
}

bar.h:

class bar {
public:
    void Test();
}

foo.cpp:

void foo::DoIt() {
    it.Test();
}

This will result in a: error LNK2001: unresolved external symbol

Why?

A: 

I'm dumb! I did define Test() in the class definition but did not actually have an existing Test() function :(

Sorry.

+2  A: 

You have not written the code for bar::Test() method.

Mehrdad Afshari