This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

WG: gcc 2.8.1 using (basic_-)string




>  -----Ursprüngliche Nachricht-----
> Von: 	Breuer, Markus  
> Gesendet:	Freitag, 3. November 2000 10:13
> An:	'gcc-bugs@gcc.gnu.org'
> Betreff:	gcc 2.8.1 using (basic_-)string
> 
> Hello,
> 
> we have some trouble using the gcc 2.8.1 compiler and <string>. For
> example in following programm:
> 
> --- snipp ---
> #include <string>
> 
> int main()
> {
>    basic_string<char> s;
>    s.append( "Ku-Ku" );
>    return 0;
> }
> --- snipp ---
> 
> While compiling it with "g++ myfile.cpp" there's no trouble. But when I am
> using the commandline "g++ -D_PTHREADS myfile.cpp",
> the linker cannot solve some symbols:
> 
> (5)> c++ -D_PTHREADS myfile.cpp 
> Undefined                       first referenced
>  symbol                             in file
> _t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b
> 1i0.nilRep /var/tmp/ccYdaGfE1.o
> replace__t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_te
> mplate2b1i0UiUiPCcUi /var/tmp/ccYdaGfE1.o
> __dl__Q2t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_tem
> plate2b1i03RepPv /var/tmp/ccYdaGfE1.o
> clone__Q2t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_te
> mplate2b1i03Rep /var/tmp/ccYdaGfE1.o
> ld: fatal: Symbol referencing errors. No output written to a.out
> 
> After some looking in the g++ include-path I did following:
> 
> #include <std/bastring.cc>
> 
> In this way all symbols are solved. But I think it may not be the right
> way, generally an include <string> should be okay. In my opinion
> bastring.* are internal includes which a programmer should never include
> directly. Is there any other way? My app should work on different
> plattforms while using treads and STL ...
> 
> I am currently using Solaris 7 with gcc 2.8.1.
> 
> Markus

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