Cannot call read function!
I am trying to use the code posted here:
http://www.senzee5.com/2008/02/java-style-properties-files-in-c.html
I use it like this:
#include "propertyutil.h"
int main(){
PropertyUtil properties;
typedef PropertyUtil::PropertyMapT MapType;
MapType bob;
properties.read(config_path.c_str(), bob);
return 0;
}
but I get the error:
main.cpp:(.text+0xc29): undefined reference to `PropertyUtil::read(char
const*, std::map<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::less<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
std::allocator<std::pair<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > const, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > > >&)'
'read' is:
class PropertyUtil {
enum { DEBUG = 0 };
public:
typedef std::map<std::string, std::string> PropertyMapT;
typedef PropertyMapT::value_type value_type;
typedef PropertyMapT::iterator iterator;
static void read(const char *filename, PropertyMapT &map);
...
...
What am I doing wrong here?