Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Sun, 11 Mar 2001 16:26:52 -0800 Message-Id: <200103120026.QAA11213@mail6.bigmailbox.com> Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: binary X-Mailer: MIME-tools 4.104 (Entity 4.116) Mime-Version: 1.0 X-Originating-Ip: [24.128.249.138] From: "Jacob Stoddard" To: cygwin AT cygwin DOT com Subject: STL Newbie: vector of strings won't link To good Samaritans smarter than me, I wrote a simple program with STL to get familiar with it. It works on VC++ 6.0, but not gcc-2.95.2-6. -------------------------------------------------------------- #include #include #include using namespace std; // I've tried it with and without this void main() { string my_string( "Hello World!\n" ); vector my_vector; my_vector.push_back( my_string ); // It'll link fine without this cout << my_vector[0]; } ------------------------------------------------------------- That's it! The linker gives an undefined reference error for __uninitialized_copy_aux(...) for string. Sometimes, it will also give undefined reference error for __destroy_aux(...) for string. Here's the __uninitialized_copy_aux error message if it makes any difference: (I'd give the one for __destroy_aux(...) as well, but I can't get it to happen again... it comes and goes.) stltest.o(.text$__uninitialized_copy__H3ZPt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0ZPt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0_X01X01X11PX21_X11+0x21): undefined reference to `basic_string, __default_alloc_template > * __uninitialized_copy_aux, __default_alloc_template > *, basic_string, __default_alloc_template > *>(basic_string, __default_alloc_template > *, basic_string, __default_alloc_template > *, basic_string, __default_alloc_template > *, __false_type)' I've tried the STL library that came with cygwin, SGI STL, and STLport; still didn't work. Note: A stack of strings *does* work. Any help would be much appreciated. --Jake ------------------------------------------------------------ Free Entertainment: Humor, Web Games, & More - http://www.rinkworks.com/ Free Email: RinkMail - http://www.rinkworks.com/rinkmail/ -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple