This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Problem compiling/using string
- To: libstdc++@sourceware.cygnus.com
- Subject: Problem compiling/using string
- From: ecmorgan@lucent.com
- Date: Mon, 17 May 1999 10:41:09 -0400 (EDT)
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 |
*==========================================*