//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); }
Either remove stdafx.h from the project, and turn of precompiled headers.. or try moving head.h to be included after stdafx.h instead of before.