I'm currently using the class given in this tutorial: http://www.dreamincode.net/forums/topic/183191-create-a-simple-configuration-file-parser/
Initially it worked fine, but since I split the single source file into seperate header and cpp files I've been unable to call the getValueOfKey function
header:
#ifndef CONFIGFILE_H
#define CONFIGFILE_H
#include <iostream>
#include <string>
#include <sstream>
#include <map>
#include <fstream>
#include <typeinfo>
class ConfigFile
{
private:
        std::map<std::string, std::string> contents;
    std::string fName;
    void removeComment(std::string &line) const;
    bool onlyWhitespace(const std::string &line) const;
    bool validLine(const std::string &line) const;
    void extractKey(std::string &key, size_t const &sepPos, const std::string &line) const;
    void extractValue(std::string &value, size_t const &sepPos, const std::string &line) const;
    void extractContents(const std::string &line);
    void parseLine(const std::string &line, size_t const lineNo);
    void ExtractKeys(); 
public:
    ConfigFile(const std::string &fName);
    bool keyExists(const std::string &key) const;
    template <typename ValueType>
    ValueType getValueOfKey(const std::string &key, ValueType const &defaultValue) const;
};
#endif  /* CONFIGFILE_H */
cpp:
#include "ConfigFile.h"
std::map<std::string, std::string> contents;
std::string fName;
template <typename T>
static std::string T_to_string(T const &val)
{
    std::ostringstream ostr;
    ostr << val;
    return ostr.str();
}
template <typename T>
static T string_to_T(std::string const &val)
{
    std::istringstream istr(val);
    T returnVal;
    if (!(istr >> returnVal))
        std::cout << "CFG: Not a valid " << (std::string)typeid (T).name() << " received!\n" << std::endl;
    return returnVal;
}
template <>
std::string string_to_T(std::string const &val)
{
    return val;
}
void ConfigFile::removeComment(std::string &line) const
{
    if (line.find(';') != line.npos)
        line.erase(line.find(';'));
}
bool ConfigFile::onlyWhitespace(const std::string &line) const
{
    return (line.find_first_not_of(' ') == line.npos);
}
bool ConfigFile::validLine(const std::string &line) const
{
    std::string temp = line;
    temp.erase(0, temp.find_first_not_of("\t "));
    if (temp[0] == '=')
        return false;
    for (size_t i = temp.find('=') + 1; i < temp.length(); i++)
        if (temp[i] != ' ')
            return true;
    return false;
}
void ConfigFile::extractKey(std::string &key, size_t const &sepPos, const std::string &line) const
{
    key = line.substr(0, sepPos);
    if (key.find('\t') != line.npos || key.find(' ') != line.npos)
        key.erase(key.find_first_of("\t "));
}
void ConfigFile::extractValue(std::string &value, size_t const &sepPos, const std::string &line) const
{
    value = line.substr(sepPos + 1);
    value.erase(0, value.find_first_not_of("\t "));
    value.erase(value.find_last_not_of("\t ") + 1);
}
void ConfigFile::extractContents(const std::string &line)
{
    std::string temp = line;
    temp.erase(0, temp.find_first_not_of("\t "));
    size_t sepPos = temp.find('=');
    std::string key, value;
    extractKey(key, sepPos, temp);
    extractValue(value, sepPos, temp);
    if (!keyExists(key))
        contents.insert(std::pair<std::string, std::string > (key, value));
    else
        std::cout << "CFG: Can only have unique key names!\n" << std::endl;
}
void ConfigFile::parseLine(const std::string &line, size_t const lineNo)
{
    if (line.find('=') == line.npos)
        std::cout << "CFG: Couldn't find separator on line: " << T_to_string(lineNo) << "\n" << std::endl;
    if (!validLine(line))
        std::cout << "CFG: Bad format for line: " << T_to_string(lineNo) << "\n" << std::endl;
    extractContents(line);
}
void ConfigFile::ExtractKeys()
{
    std::ifstream file;
    file.open(fName.c_str());
    if (!file)
        std::cout << "CFG: File " << fName << " couldn't be found!\n" << std::endl;
    std::string line;
    size_t lineNo = 0;
    while (std::getline(file, line))
    {
        lineNo++;
        std::string temp = line;
        if (temp.empty())
            continue;
        removeComment(temp);
        if (onlyWhitespace(temp))
            continue;
        parseLine(temp, lineNo);
    }
    file.close();
}
ConfigFile::ConfigFile(const std::string &fName)
{
    this->fName = fName;
    ExtractKeys();
}
bool ConfigFile::keyExists(const std::string &key) const
{
    return contents.find(key) != contents.end();
}
template <typename ValueType>
ValueType ConfigFile::getValueOfKey(const std::string &key, ValueType const &defaultValue = ValueType()) const
{
    if (!keyExists(key))
        return defaultValue;
    return string_to_T<ValueType> (contents.find(key)->second);
}
I am attempting to call it using the same method as when it was a single file, something like std::cout << Config.getValueOfKey<std::string>("test");, but now I am getting the following compiler error 
main.cpp: In function 'int main(int, char**)':
main.cpp:29:71: error: no matching function for call to 'ConfigFile::getValueOfKey(const char [5])'
main.cpp:29:71: note: candidate is:
In file included from main.h:17:0,
                 from main.cpp:9:
ConfigFile.h:35:12: note: template<class ValueType> ValueType ConfigFile::getValueOfKey(const string&, const ValueType&) const
ConfigFile.h:35:12: note:   template argument deduction/substitution failed:
main.cpp:29:71: note:   candidate expects 2 arguments, 1 provided
Given my poor grasp on templates I can't really see what this error is trying to tell me, I have tried passing a direct string instead of a char array to no avail. Any help or explanation would be greatly appreciated, my heads worn a nice hole in the desk over the past few hours.
 
     
     
    