 |
 |
| update... |
 |
 |
By eli - Posted on July 18, 2004 - 17:09:01 (#13380)
Current version when comment was posted: 4.6 |
 |
 |
I've just built STLPort 4.6.2 on BeOS. For whatever the reason, the build script doesn't build shared libraries (maybe my mistake), but the bit of code I posted is now properly working if I link against the static library, as you mentioned. I'll just keep using the static library until we have a real solution for the shared libs. Strange as it may seem, I had only encountered the original problem I posted when working with floats / doubles. Every other data type was correctly streaming -- inserting a float / double into the stream gave rise to a fail(). I'll try and build the shared libs some other time. As an aside, I can't massage STLPort beta 5.0 into compiling on BeOS. Thanks for your quick reply, BeAR, I appreciate it.
|
|
| Re: ostringstream broken? |
 |
 |
By BeAR - Posted on July 18, 2004 - 12:04:32 (#13378)
Current version when comment was posted: 4.6 |
 |
 |
I still can't figure out why shared libs didn't work. Sorry. Btw, there is a working BeOS-port of STLport 4.5.3 somewhere on BeShare. Compiled by somebody else and with shared libs.
|
|
| ostringstream broken? |
 |
 |
By eli - Posted on July 18, 2004 - 10:54:47 (#13376)
Current version when comment was posted: 4.6 |
 |
 |
for some reason, I cannot seem to work with doubles and/or floats via ostringstream. Here's a snippet of code I'm testing:
ostringstream oss;
double const e = 2.71828182846;
oss << e;
cout << oss.str() << endl;
with <sstream> included.
Since Be's libstdc++ doesn't offer sstream, I tried the same bit of code, with a strstream instead, and linking to libstdc++ instead of stlport, and the code is working ok. I then tried using strstream with stlport, linking to stlport and I get garbage in oss.str().
Any ideas? Am I doing something wrong? Did I find a bug?
|
|
| It works with all 2.9* versions of gcc avaible for BeOS |
 |
 |
By BeAR - Posted on December 23, 2003 - 10:58:30 (#10134)
Current version when comment was posted: 4.6 |
 |
 |
Just installed gcc 2.9-beos-991026 from BeOS R5 Pro CD. STLport's streams work with it as well.
Are there any other users who have problems with STLport's streams?
|
|
| Re: Streams |
 |
 |
By BeAR - Posted on December 23, 2003 - 10:19:51 (#10133)
Current version when comment was posted: 4.6 |
 |
 |
I've tested your examples on my machine both in Dano and R5 and they just work! With gcc 2.9-000224.
|
|
| Streams |
 |
 |
By pgr - Posted on December 23, 2003 - 07:17:36 (#10130)
Current version when comment was posted: 4.6 |
 |
 |
I replaced Be's gcc with the more recent version gcc 2.95.3. Now streaming of integers works. But I don't know if it is a good idea to use 2.95.3...
|
|
| streams |
 |
 |
By BeAR - Posted on December 22, 2003 - 23:49:20 (#10117)
Current version when comment was posted: 4.6 |
 |
 |
Hmm... seams like a bug... I'll see what I can do...
Btw, libstlport_gcc.so is needed only if you want to use STLport's streams. STLport can work with wrapped native streams. By default this feature is disabled.
To enable wrapped mode you should uncomment line
// # define _STLP_NO_OWN_STREAMS 1
in /boot/develop/headers/stlport/stl_user_config.h
or pass -D_STL_NO_OWN_STREANS=1 option to compiler.
Since then you should use standard libstdc++.r4.so instead of libstlport_gcc.so
|
|
| Re: Re:flush() |
 |
 |
By pgr - Posted on December 22, 2003 - 19:53:58 (#10113)
Current version when comment was posted: 4.6 |
 |
 |
std::cout << 99 << std::flush << std::endl;
OR
std::cout << int(99) << std::flush << std::endl;
do not work either.
Output of (c)strings and chars work, e. g.:
std::cout << std::string("hello") << std::endl;
This can't be my fault :-)
|
|
| Re:flush() |
 |
 |
By s_d - Posted on December 22, 2003 - 13:01:49 (#10102)
Current version when comment was posted: 4.6 |
 |
 |
did you guys try something like
std::cout.flush();
after
std::cout << foo;
????
|
|
| Re: Err.... |
 |
 |
By pgr - Posted on December 22, 2003 - 11:01:33 (#10098)
Current version when comment was posted: 4.6 |
 |
 |
1 int x = 76;
2 std::cout << x << '\n';
...does not output either.
By the way: int(76) is standard c++.
|
|
| Er.... |
 |
 |
By Jack Burton - Posted on December 22, 2003 - 10:11:11 (#10096)
Current version when comment was posted: 4.6 |
 |
 |
Because you're actually trying to call the int() function, I guess :P
A typo or whatever...
Anyway, the correct syntax is
cout << (int)76;
|
|
| i don't get i work |
 |
 |
By pgr - Posted on December 22, 2003 - 05:19:40 (#10095)
Current version when comment was posted: 4.6 |
 |
 |
A simple std::cout << "hello" << '\n' works. Doing a std::cout << int(76) << '\n' outputs nothing. What's the reason for this?
|
|
|
|
|