[Comm] Re: Компоновка с STL в gcc3

Прокопьев Евгений =?iso-8859-1?q?john_=CE=C1_rmts=2Edonpac=2Eru?=
Пн Апр 14 16:52:46 MSD 2003


> А если при сборке вызывать тоже g++, а не gcc?

$ make clean
rm -f *.o requester
$ make
g++    -c -o requester.o requester.cpp
g++    -c -o serial.o serial.cpp
g++    -c -o sulim.o sulim.cpp
g++  -o requester requester.o serial.o sulim.o xmlconfig/XMLConfig.o 
-lstdc++ -lexpat
sulim.o: In function `std::basic_string<unsigned char, 
std::char_traits<unsigned char>, std::allocator<unsigned char> 
 >::find(unsigned char const*, unsigned) const':
sulim.o(.gnu.linkonce.t._ZNKSbIhSt11char_traitsIhESaIhEE4findEPKhj+0xd): 
undefined reference to `std::char_traits<unsigned char>::length(unsigned 
char const*)'
sulim.o: In function `std::basic_string<unsigned char, 
std::char_traits<unsigned char>, std::allocator<unsigned char> 
 >::find(unsigned char const*, unsigned, unsigned) const':
sulim.o(.gnu.linkonce.t._ZNKSbIhSt11char_traitsIhESaIhEE4findEPKhjj+0x4c): 
undefined reference to `std::char_traits<unsigned 
char>::compare(unsigned char const*, unsigned char const*, unsigned)'
sulim.o: In function `std::basic_string<unsigned char, 
std::char_traits<unsigned char>, std::allocator<unsigned char> 
 >::_Rep::_M_clone(std::allocator<unsigned char> const&, unsigned)':
sulim.o(.gnu.linkonce.t._ZNSbIhSt11char_traitsIhESaIhEE4_Rep8_M_cloneERKS1_j+0xaa): 
undefined reference to `std::char_traits<unsigned char>::copy(unsigned 
char*, unsigned char const*, unsigned)'
sulim.o: In function `std::basic_string<unsigned char, 
std::char_traits<unsigned char>, std::allocator<unsigned char> 
 >::_M_mutate(unsigned, unsigned, unsigned)':
sulim.o(.gnu.linkonce.t._ZNSbIhSt11char_traitsIhESaIhEE9_M_mutateEjjj+0x143): 
undefined reference to `std::char_traits<unsigned char>::copy(unsigned 
char*, unsigned char const*, unsigned)'
sulim.o(.gnu.linkonce.t._ZNSbIhSt11char_traitsIhESaIhEE9_M_mutateEjjj+0x170): 
undefined reference to `std::char_traits<unsigned char>::copy(unsigned 
char*, unsigned char const*, unsigned)'
sulim.o(.gnu.linkonce.t._ZNSbIhSt11char_traitsIhESaIhEE9_M_mutateEjjj+0x283): 
undefined reference to `std::char_traits<unsigned char>::move(unsigned 
char*, unsigned char const*, unsigned)'
sulim.o: In function `std::basic_string<unsigned char, 
std::char_traits<unsigned char>, std::allocator<unsigned char> 
 >::_S_copy_chars(unsigned char*, unsigned char const*, unsigned char 
const*)':
sulim.o(.gnu.linkonce.t._ZNSbIhSt11char_traitsIhESaIhEE13_S_copy_charsEPhPKhS5_+0x1b): 
undefined reference to `std::char_traits<unsigned char>::copy(unsigned 
char*, unsigned char const*, unsigned)'
collect2: ld returned 1 exit status
make: *** [requester] Ошибка 1

-- 
С уважением, Прокопьев Евгений




Подробная информация о списке рассылки community