I have several functions in a .cpp file and I want several of my projects use the same file. So instead of copy them to different directories just add them (from original location) to project file in visual studio and use them.
The problem is #include "stdafx.h" seems to refer to the same directory as the file exist and this causes compiler problems.
Is there a way or workaround or am I doing something conceptually wrong?
(I think making it as a static library is a bit overkill. compiling and building new project and making sure others are using correct DEBUG/RELEASE .lib. Hmmmm. A bit hard for a lazy coder!)
#include "stdafx.h"
. Then right click on the file in the Solution Explorer, select properties, and somewhere in the options pages for C/C++ there's an option to disable precompiled headers. You could also switch them off for the entire project. – Praetorian