//head.h// extern int sum(int,int);
//head.cpp// #include \"head.h\" #include \"stdafx.h\" int sum(int x, int y) { return (x+y); } >
//head.cpp// #include \"head.h\" #include \"stdafx.h\" int sum(int x, int y) { return (x+y); }
You need to place the inclusion of head.h after stdafx.h. When precompiled headers are enabled the compiler will ignore the contents of all includes that occur prior to (in this case) the inclusion of stdafx.h .