Common Linking Problem. Simple.
All of my function calls in main of a certain class (say foo) are being marked by the linker as "undefined references". Here's my setup:
foo.h:
Code:
#ifdef ...
namespace foobar
{
class foo{...};
namespace exception
{
class anexception{};
}
}
#endif
foo.cpp
Code:
#include "foo.h"
using namespace foobar;
foo::a_function()...
. . .
main.cpp
Code:
#include "foo.h"
int main()
{
foo foo_instance;
foo_instance.a_function();
return EXIT_SUCCESS;
}
Where is my format wrong? What aren't I including correctly, etc?