Advertisement

VS .NET and sstream

Started by March 02, 2002 11:18 AM
5 comments, last by Ziphnor 22 years, 6 months ago
One of the few things that still causes me to make mistakes after converting from Java to C++ is string-manipulation. I HATE char*'s Ive noticed that in some books they use ostringstream together with string to ease string stuff. Well in the book im looking at he uses #include <sstream>. When i try that in VS .NET i get 53(!) build errors related not to my own code but to code found in sstream Actually this program gets 53 build errors ->
    
#include <sstream>

int main()
{
	return 0;
}
    
(needless to say leaving out the include statement means getting no errors Anyone know whats wrong? Edited by - ziphnor on March 2, 2002 12:23:48 PM
Sounds a lot like a problem in the STL shipped with your compiler. There''s nothing wrong with that code (I just tested it in GCC). I can''t prove it though, since I don''t own VS .NET.

Advertisement
Compiled and linked without either warnings nor errors in VC++.NET beta 2. Dont have access to the RTM yet, but I sincerely doubt they managed to break something like that.

The world holds two classes of men -- intelligent men without religion, and religious men without intelligence. Abu''l-Ala-Al-Ma''arri (973-1057; Syrian poet)
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
Just tried it on VC++ 6 on my laptop, and it compiles without any problems, i must have screwed up the include directories or something like that(because i do have both SGI STL and STLPort installed).

Btw, isnt ostringstream defined in sstream? Because VC++6 doesnt like this:
#include <sstream>int main(){	ostringstream test;	return 0;} 

It complains it doesnt know what ostringstream is...
It''s in the std namespace.

Just found out that myself, feel like an idiot
Thanks anyway.
Advertisement
Found out what was wrong, the SGI STL implementations include dir was searched BEFORE the regular Vc++ include files. SGI STL doesnt have a sstream file, but it must include some files which can also be found in the SGI STL.
It works now, hope changing this doesnt screw things up elsewhere where i am using the SGI hashmap...

This topic is closed to new replies.

Advertisement