|
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
string str;
vector<char> v1;
return 0;
}
在上面一段程序中,在vc 中可以的,但是在linux(Debian)中,对于编译vector 通过,但是编译string 没通过,为何?
错误码:
fadd:/home/main# gcc new.cpp -o aa
/tmp/ccesxd04.o: In function `basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >::Rep::copy(unsigned int, char const *, unsigned int)':
/tmp/ccesxd04.o(.basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >::Rep::gnu.linkonce.t.copy(unsigned int, char const *, unsigned int)+0x33): undefined reference to `string_char_traits<char>::copy(char *, char const *, unsigned int)'
collect2: ld returned 1 exit status
谢谢指点! |
|