delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/11/19:27:50

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
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>
X-Mailer: MIME-tools 4.104 (Entity 4.116)
Mime-Version: 1.0
X-Originating-Ip: [24.128.249.138]
From: "Jacob Stoddard" <jagdev AT rinkworks DOT com>
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 <string>
#include <vector>
#include <iostream.h>

using namespace std;      // I've tried it with and without this

void main()
{
    string my_string( "Hello World!\n" );

    vector<string> 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<char, string_char_traits<char>, __default_alloc_template<false, 0> > * __uninitialized_copy_aux<basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> > *, basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> > *>(basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> > *, basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> > *, basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> > *, __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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019