Quick Question about an Error Message

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aemado
    New Member
    • Sep 2007
    • 17

    #1

    Quick Question about an Error Message

    This function is in a separate .cpp file from my main, where it is called. I am really new to STL, and think that the problem has something to do with the parameter, but I don't know what. Here is my error message:

    error LNK2019: unresolved external symbol....

    in this function:
    Code:
    void printS(list<studentdata>::iterator i)
    {
    	cout<<"\n\tID number\t"<<i->getIDnumber();
    	cout<<"\n\tLast name\t"<<i->getlname();
    	cout<<"\n\tFirst name\t"<<i->getfname();
    	cout<<"\n\tMajor\t\t"<<i->getmajor();
    	cout<<"\n\tClass\t\t"<<i->getyear()<<endl;
    }
    Thanks!
  • Laharl
    Recognized Expert Contributor
    • Sep 2007
    • 849

    #2
    If you didn't #include <list> or type 'using namespace std;' after your includes, do so. Otherwise, do the #include and refer to the list as std::list. The issue could also be if you forgot to #include the header file for your studentdata class (if there is one). That include would be #include "filename.h " since it's not system-supplied.

    Comment

    Working...