I'm finding myself stuck trying to simply get a userInfo class's sets to work, but every time I try and compile with simple code like this in my application file:

userInfo stuff;

stuff.setId("test");

It gives me one of those 'undefined symbol' errors and references to the userInfo::setId function:

Undefined first referenced
symbol in file
userInfo::setId(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)/var/tmp//cc1wjEkh.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status

The sets are implemented as follows in my implementation file:

void userInfo::setId(string anId) { id = anId;}
void userInfo::setPassword(string passwd) {password = passwd;}

Not sure if I'm missing some vital or obvious factor about the userInfo sets. Any help would be MUCH appreciated.

Could you post the deceleration for your userInfo class? Also please use code tags.

void userInfo::setId(string anId) { id = anId;}

What's id? Is that definitely a member of the userInfo class

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.