This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: at() (still not compiled)
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: Re: at() (still not compiled)
- From: Takanori YOSHIKOSHI <tyoshiko at sci dot osaka-cu dot ac dot jp>
- Date: Tue, 29 Feb 2000 17:17:27 +0900
- References: <20000229101842X.tyoshiko@uhepc12.sci.osaka-cu.ac.jp>
I wrote:
> I knew that there is a bug in libstdc++ with gcc 2.95.2
> and the following program cannot be compiled.
>
> // tmp.cc
> #include <vector>
>
> using namespace std;
>
> int main()
> {
> int a[] = {1, 2, 3};
> vector<int> v(a, a + 3);
> v.at(2);
> return 0;
> }
>
> So, I downloaded libstdc++-2.90.7 and could make it
> following the instruction in RELEASE-NOTES. But,
> the above program cannot be compiled even using the
> new library.
>
> $ g++ -I/usr/local/include/g++-v3 tmp.cc
> /tmp/ccKljuEL.o: In function `vector<int, allocator<int> >::_M_range_check(unsigned int) const':
> /tmp/ccKljuEL.o(.vector<int, allocator<int> >::gnu.linkonce.t._M_range_check(unsigned int) const+0x29): undefined reference to `__stl_throw_range_error(char const *)'
> collect2: ld returned 1 exit status
Oops, I have forgot to link the library.
$ g++ -I/usr/local/include/g++-v3 -L/usr/local/lib tmp.cc
compiles it. Sorry for that.
--
Taka Yoshikoshi
tyoshiko@sci.osaka-cu.ac.jp