[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
<vector> link error (?)
From: |
Evert, dr.ir. F.K. van |
Subject: |
<vector> link error (?) |
Date: |
Mon, 26 Mar 2001 14:04:48 +0200 |
The following simple program doesn't compile under my installations of gcc
(Cygwin and Linux Redhat):
#include <vector>
void main()
{
std::vector<int> v;
v.push_back(44);
};
Output is shown below:
$ gcc vtest.cpp
/cygdrive/c/windows/TEMP/ccRVuIgL.o(.__malloc_alloc_template<0>::text$_S_oom
_mal
loc(unsigned int)+0x1a):vtest.cpp: undefined reference to `endl(ostream &)'
/cygdrive/c/windows/TEMP/ccRVuIgL.o(.__malloc_alloc_template<0>::text$_S_oom
_mal
loc(unsigned int)+0x27):vtest.cpp: undefined reference to `cerr'
/cygdrive/c/windows/TEMP/ccRVuIgL.o(.__malloc_alloc_template<0>::text$_S_oom
_mal
loc(unsigned int)+0x2c):vtest.cpp: undefined reference to
`ostream::operator<<(c
har const *)'
collect2: ld returned 1 exit status
Do I need to explicitly link in some library or other? Programs that do not
make use of <vector> compile and run fine.
Any help would be much appreciated.
Regards,
Frits
F.K. van Evert
Plant Research International
P.O. Box 16
6700 AA Wageningen
The Netherlands
Phone: (+31) 317-475957
Fax: (+31) 317-423110
- <vector> link error (?),
Evert, dr.ir. F.K. van <=