searching vector [ error included version  & orginal code & Makefile  ]
<ul>
<li>It gives so many error, why ?  </li>
<li>How can I fix it ? </li>
</ul>

<p>My real code ;</p>

<pre><code> int  SearchUserName (  string searched,   vector&lt;User *&gt; list  )   {
 vector&lt;User *&gt; :: iterator it ;
 for ( it = list.begin() ; it &lt; list.end ( ) ; ++it ) {
    const  string tmp = (*it) -&gt; getUsername() ;
    if ( tmp  == searched ) return 1 ;
 }     
return 0 ;
}
  // SocialNet :: createUser
  void SocialNet :: createUser (const string username, const string name, \
                          const string surname)   throw ( SocialNetException ) {
  int tmp = SearchUserName ( username, this -&gt; users ) ;
  if(  tmp  == 0) {
     User *tmp = NULL ;
     tmp = new User( username, name, surname ) ;
     users.push_back ( tmp ) ;     
       return ;
 }
 throw  SocialNetException (USER_ALREADY_EXISTS, username)  ; 
}
</code></pre>

<p>Finally, I have find, Error: </p>

<p>(.text+0x20): undefined reference to <code>main'
/tmp/cckzaRBZ.o: In function</code>SearchUserName(std::basic_string, std::allocator >, std::vector >)':
SocialNet.cpp:(.text+0x47): undefined reference to <code>User::getUsername() const'
/tmp/cckzaRBZ.o: In function</code>SocialNet::createUser(std::basic_string, std::allocator >, std::basic_string, std::allocator >, std::basic_string, std::allocator >)':
SocialNet.cpp:(.text+0x258): undefined reference to `User::User(std::basic_string, std::allocator >, std::basic_string, std::allocator >, std::basic_string, std::allocator >)'</p>

<p>EDIT: 
in makefile ;</p>

<pre><code> CXX = g++
 CXXFLAGS_W = -Werror -Wunused-variable -Wunused-value -Wunused-function \
         -Wfloat-equal -Wall
 CXXFLAGS_M = -ansi  -pedantic-errors
 CXXFLAGS = ${CXXFLAGS_M} ${CXFLAGS_W}

 all:    main
        ./main
</code></pre>

<p>compile ; make filename</p>
