I am a little baffled at this error. I have a header file "common_include.h" which contains some miscellaneous Global functions and inclusions of commonly used header files. Here's the file:
#ifndef COMMON_INCLUDE_H
#define COMMON_INCLUDE_H
#define WIN32_LEAN_AND_MEAN
#include <atlbase.h>
#include <memory>
#include <string>
template <class T> void SafeRelease(T **ppT)
{
if (*ppT)
{
(*ppT)->Release();
*ppT = 0;
}
};
const std::wstring appPath = L"C:\\Users\\Jared\\Documents\\Visual Studio 2012\\Projects\\nbody_simulation\\";
std::wstring GetFilePath(const std::wstring &fileName)
{
std::wstring tmp = std::wstring(appPath.data());
return tmp.append(fileName.data());
}
#endif
I use GetFilePath() 3 times in my code in other files and the linker is complaining that I have multiply defined symbols? what am I doing wrong?