I have created a sample c++ project under Visual Studio 2010 with following files.
A.h
#ifndef A_H
#define A_H
#include
void foo();
#
I think what happened is that A.h was in the Source group of the project rather than the Header group, so it was compiled as if it were a .cpp. Since both A.cpp and A.h will generate an object file A.obj, the last one to compile is the only one that got linked. I believe the last one compiled was A.h, which didn't have an implementation of foo(), thus the linker couldn't find it.