I need to define a constant containing an environment variable (Linux, g++). I would prefer to use string, but std::getenv needs *char
string
std::getenv
*char
Use
extern const char* ENV_APPL_ROOT;
in the header file, and place
const char* ENV_APPL_ROOT = "APPL_ROOT";
in one particular translation unit (e.g. DataLocation.cpp).
DataLocation.cpp
This should fix it.