Thread: stringstream problem

  1. #1
    Registered User
    Join Date
    Dec 2006
    Posts
    40

    stringstream problem

    I'm trying to write a string into my stringstream but my compiler is coming up with a whole list of errors. Here's the code:

    Code:
    //Dustin Nicholes
    //CS 240
    //Web crawler driver class
    
    #include "stopWord.h"
    #include "URL.h"
    #include <fstream>
    #include <iostream>
    #include <sstream>
    #include <stdlib.h>
    using namespace std;
    
    int main(int argc, char* argv[])
    {
    	//Get the arguments from the command line
    	string startURL(argv[1]);
    	string outputFile(argv[2]);
    	string stopFile(argv[3]);
    
    	//Send the start URL to a class that determines if it is HTML and can also do things like determine the Absolute URL
    	//This is also where the robot filiter is started from
    	URL url(startURL);
    
    	//Open the stop words file
    	fstream file;
    	file.open(stopFile.c_str());
    	stopWord::stopWord(file);
    
    	//Setup the structure that will contain unprocessed URLs
    	stringstream URLsToProcess;
    	URLsToProcess<<startURL;   //THIS LINE WON'T COMPILE!!
    	
    	//While we still have unprocessed URLs, Process them!
    	string currentURL;
    	while(currentURL<<URLsToProcess)
    	{
    		//Create a class that can parse the words, headers, new URLs, etc...
    		PageParser parser(currentURL, stopWords);
    		
    		/*
    		//Create a new page
    		Page* page = new Page(parser);
    		if(pages doesn't contain this new page already)
    		{
    			//Add the new page to the data structure containing all of the processed pages
    			pages.add(page);
    			//Retrieve all of the new URLs from the page and add them to the pseudo queue
    			URLsToProcess<<parser.getNewURLs;
    		}
    		*/
    	}
    	
    	//Write the file to XML
    	std::ofstream outFile(outputFile);
    	//XMLwriter output(pages, startURL);
    	//output.writeOut(outFile);
    	
    	return 0;
    }
    And if it helps, one of the errors the compiler is returning is:

    driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std:perator <<(std::basic_ostream<_Elem,_Traits> &,const std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1> c:\program files\microsoft visual studio 9.0\vc\include\string(537) : see declaration of 'std:perator <<'
    Thanks in advance for the help!

  2. #2
    Registered User
    Join Date
    Dec 2006
    Posts
    40
    Please help? I really don't understand.

  3. #3
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    This compiles just fine with gcc:

    Code:
    #include <sstream>
    using namespace std;
    
    int main(int argc, char* argv[])
    {
    	//Get the arguments from the command line
    	string startURL(argv[1]);
    
    	//Setup the structure that will contain unprocessed URLs
    	stringstream URLsToProcess;
    	URLsToProcess<<startURL;   //THIS LINE WON'T COMPILE!!
    	
    	return 0;
    }
    Mainframe assembler programmer by trade. C coder when I can.

  4. #4
    Registered User
    Join Date
    Dec 2006
    Posts
    40
    Is it possible that this works on one compiler and not another? He is the complete compiler output:

    Code:
    1>------ Build started: Project: LinkedListTest, Configuration: Debug Win32 ------
    1>Compiling...
    1>driver.cpp
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\string(537) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\string(537) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\string(537) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\string(537) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,unsigned char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(930) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,unsigned char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(930) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,unsigned char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(930) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,unsigned char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(930) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(923) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(923) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(923) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const unsigned char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(923) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,signed char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(916) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,signed char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(916) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,signed char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(916) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,signed char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(916) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const signed char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(909) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const signed char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(909) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const signed char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(909) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const signed char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(909) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,_Elem)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(871) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,_Elem)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(871) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,_Elem)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(871) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,_Elem)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(871) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(825) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(825) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(825) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const _Elem *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(825) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(785) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(785) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(785) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(785) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(738) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(738) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(738) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<char,_Traits> &std::operator <<(std::basic_ostream<char,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<char,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(738) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(700) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(700) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(700) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,char)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(700) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(653) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(653) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(653) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2784: 'std::basic_ostream<_Elem,_Traits> &std::operator <<(std::basic_ostream<_Elem,_Traits> &,const char *)' : could not deduce template argument for 'std::basic_ostream<_Elem,_Traits> &' from 'std::string'
    1>        c:\program files\microsoft visual studio 9.0\vc\include\ostream(653) : see declaration of 'std::operator <<'
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : error C2676: binary '<<' : 'std::string' does not define this operator or a conversion to a type acceptable to the predefined operator
    1>c:\users\dustin nicholes\documents\visual studio 2008\projects\linkedlisttest\linkedlisttest\driver.cpp(35) : fatal error C1903: unable to recover from previous error(s); stopping compilation
    1>Build log was saved at "file://c:\Users\Dustin Nicholes\Documents\Visual Studio 2008\Projects\LinkedListTest\LinkedListTest\Debug\BuildLog.htm"
    1>LinkedListTest - 46 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  5. #5
    The larch
    Join Date
    May 2006
    Posts
    3,573
    Your error appears to relate to another line.

    error C2676: binary '<<' : 'std::string' does not define this operator or a conversion to a type acceptable to the predefined operator
    This should refer to this line:
    Code:
    while(currentURL<<URLsToProcess)
    Which should look like this:
    Code:
    while (URLsToProcess >> currentURL)
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  6. #6
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Where do you include <string>?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. stringstream to float problem
    By c0d3m0nk3y in forum C++ Programming
    Replies: 10
    Last Post: 02-01-2008, 04:07 AM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM