Issue with g++/gcc 5.2.0 on cygwin about string and std cout

Tim Prince n8tm@aol.com
Fri Oct 2 02:14:00 GMT 2015



On 10/1/2015 8:35 PM, Pat. N. wrote:
> Hi,
>
> I'm running my C++ program on Cygwin, using g++ compiler version 5.2.0.
>
> The std::string is hiding the output of std::cout.
>
> For example, this simple program should show an output, but it's showing any:
>
> #include <iostream>
>
> int main()
> {
> 	std::string as = " 12345";
> 	std::cout << "ABC" << as << std::endl;
> 	
> 	return 0;
> }
>
> We should see "ABC 12345" but instead, we see "".
>
> I don't know if the issue is on my side or on the g++/gcc side.
>
> Did I do something wrong?
This example produces your expected output using the  g++ 5.2.0 from
setup.exe on my installation.
One thing that's difficult about these gcc test versions is the need to
go all the way down the list and install the 5.2.0 version of
everything, including gcc-core, g++, libgcc, libsupc, libstdc++ .... and
to do it over and over again every time you update some other cygwin
component.

-- 
Tim Prince



More information about the Gcc-help mailing list