title: VSCode: clang: error: linker command failed with exit code 1 (use -v to see invocation)
body: <p>I've made a code for one of my classes I'm in where it should split up a string and show how many unique characters there are in a second string. However, every time I try to build the code I get "clang: error: linker command failed with exit code 1 (use -v to see invocation)". I've looked at other questions for this error and have not found a solution for VSCode (on MacBook Pro if that makes any difference). Does anybody see where my error is? Also sub question: do I necessarily need #include string? I've been told that std::string is part of iostream library. If I don't need string library for this, when is a time I would need string? Thanks everyone.</p>
  
  <pre><code>    #include &lt;iostream&gt;
      #include &lt;string&gt;
  
      int splitwords(std::string, char);
      int findnumchar(std::string);
  
      int main()
      {
          std::string txt1("ABCDEF,GHI,JKLMN,OP");
          std::string txt2("BACDGABCDAZ");
          int result;
          char delimiter = ',';
          result = splitwords(txt1, delimiter);
  
          result = findnumchar(txt2);
  
  
      }
  
      int splitwords(std::string txt, char delimiter)
      {
          int start, found, cnt = 0;
          std::string splitstr;
  
          start = 0;
          while ((found = txt.find(delimiter, start)) != std::string::npos)
          {
              splitstr = txt.substr(start, found - start);
              std::cout &lt;&lt; "Split  Word" &lt;&lt; splitstr &lt;&lt; std::endl;
              start = found + 1;
              cnt += 1;
          }
          splitstr = txt.substr(start, txt.length() - start);
          std::cout &lt;&lt; "Split  Word" &lt;&lt; splitstr &lt;&lt; std::endl;
          return cnt + 1;
      }
  
      int findnumchnar(std::string txt)
      {
  
          int uniquecnt = 0, index;
          int seen[26] = {0};
          std::string::iterator iter;
          for (iter = txt.begin(); iter &lt; txt.end(); iter++)
          {
              index = *iter - 'A';
              if (seen[index] == 0)
              {
                  seen[index] = 1;
                  uniquecnt+=1;
              }
          }
  
          for (int i = 0; i &lt;= 26; i++)
          {
              if (seen[i] == 1)
              {
                  std::cout &lt;&lt; static_cast&lt;char&gt;(i + 'A') &lt;&lt; "\t";
              }
          }
          std::cout &lt;&lt; std::endl;
          std::cout &lt;&lt; "The number of unique characters: " &lt;&lt; uniquecnt &lt;&lt; std::endl;
          return uniquecnt;
      }
  </code></pre>