public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/41005]  New: Unable to link fstream open and ctor with std::string argument.
@ 2009-08-08  2:09 3dw4rd at verizon dot net
  2009-08-10 12:26 ` [Bug libstdc++/41005] " jwakely dot gcc at gmail dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: 3dw4rd at verizon dot net @ 2009-08-08  2:09 UTC (permalink / raw)
  To: gcc-bugs

I was trying to build a simple app and use the std::string to build an ofstream
as allowed by C++-0X.

The source and header allows this.  You can compile but not link.

I've verified this on powerpc-apple-darwin7.9.0 and on x86_64-linux-unknown.

I think symbols are getting stripped out of the final library.

Here's a test case test_string_fstream.cpp
--------------------------------------------------------------

// ./bin/bin/g++ -std=c++0x -o test_string_fstream test_string_fstream.cpp

#include <string>
#include <fstream>

int
main()
{
  std::string name = "test.dat";
  std::ofstream stream( name );
}

--------------------------------------------------------------

MacOSX:~ ed$ ./bin/bin/g++ -std=c++0x -o test_string_fstream
test_string_fstream.cpp
/usr/bin/ld: Undefined symbols:
std::basic_ofstream<char, std::char_traits<char>
>::basic_ofstream(std::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&, std::_Ios_Openmode)

Here is the compiler specifics:

MacOSX:~ ed$ ./bin/bin/g++ -v                                                   
Using built-in specs.
Target: powerpc-apple-darwin7.9.0
Configured with: ../gcc/configure --prefix=/Users/ed/bin --with-gmp=/usr/local
--with-mpfr=/usr/local --enable-languages=c,c++,fortran,objc,obj-c++ :
(reconfigured) ../gcc/configure --prefix=/Users/ed/bin --with-gmp=/usr/local
--with-mpfr=/usr/local --enable-languages=c,c++,fortran,objc,obj-c++
--no-create --no-recursion
Thread model: posix
gcc version 4.5.0 20090501 (experimental) (GCC) 

Thanks,

Ed


-- 
           Summary: Unable to link fstream open and ctor with std::string
                    argument.
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: 3dw4rd at verizon dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41005


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-08-26 22:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-08  2:09 [Bug libstdc++/41005] New: Unable to link fstream open and ctor with std::string argument 3dw4rd at verizon dot net
2009-08-10 12:26 ` [Bug libstdc++/41005] " jwakely dot gcc at gmail dot com
2009-08-10 13:17 ` jwakely dot gcc at gmail dot com
2009-08-10 15:09 ` [Bug libstdc++/41005] [C++0x] " redi at gcc dot gnu dot org
2009-08-10 19:35 ` 3dw4rd at verizon dot net
2009-08-10 19:39 ` jwakely dot gcc at gmail dot com
2009-08-10 20:05 ` jwakely dot gcc at gmail dot com
2009-08-11 23:02 ` jwakely dot gcc at gmail dot com
2009-08-12  8:56 ` jwakely dot gcc at gmail dot com
2009-08-12  8:57 ` redi at gcc dot gnu dot org
2009-08-26 19:03 ` redi at gcc dot gnu dot org
2009-08-26 19:04 ` redi at gcc dot gnu dot org
2009-08-26 19:16 ` redi at gcc dot gnu dot org
2009-08-26 22:55 ` paolo dot carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).