This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


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

Re: at() (still not compiled)


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

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