I have some test code:
foo.h
#ifndef FOO_H
#define FOO_H
void Foo(int iBar);
#endif FOO_H
foo.cpp
#include "foo.h"
void Foo(int iBar)
{
// Do nothing...
}
main.cpp
#include "foo.h"
int main()
{
Foo(1);
return 0;
}
When I build the above code in VS2010 I get a linker error:
error LNK2019: unresolved external symbol "void __cdecl Foo(int)" (?Foo@@YAXH@Z) referenced in function _main
I can't figure out why my Foo() function would be unresolved at link-time. Can anybody give me some insight as to what I might be doing wrong?