This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problem compiling/using string


I am currently using egcs version 1.1.2 compiled for sparc-sun-solaris2.5.1 
and have the following code:

	#include <iostream>
	#include <string>
	int
	main()
	{
		string xxx="hello world.\n";
		cout << xxx ;
		return(0);
	}

When I compile w/o libstd++2.90.4, all works well.  But when I
compile it as follows, I get a Segmentation Fault.  

g++ -g -static \
	-L${LIBSTDC++}/lib \
	-I${LIBSTDC++}/include/g++-v3 \
	-o jnk jnk.C

where LIBSTDC++ is the --prefix value I passed to the configuration command when
I built libstdc++.

Looking closer, the error occurs in the following function:
	streamsize 
	__basic_file::xsputn(const char* __s, streamsize __n)
	{ return _IO_file_xsputn(this, __s, __n); }


What am I doing wrong?


*==========================================*
|    Edward C. Morgan                      |
|    Email:  ecmorgan@lucent.com           |
*==========================================*


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]