I would like to know how I can declare a global variable within a namespace.
In general.h I have the following code:
#include <iostream>
#pragma once
#ifndef TEST_NAMESPACE
#define TEST_NAMESPACE
namespace general
{
int n;
}
#endif
In my program when I include general.h I have this error :
Error LNK2005 "int general::n" (? n@general@@3HA) already defined in general.obj