This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Undefined symbol
- From: "Muñoz, Enrique (Laninfo)" <Enmunoz at lanchile dot cl>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 12 Jun 2003 17:24:20 -0400
- Subject: Undefined symbol
I am trying to compile a C++ program that use STL. The program source code
is:
#include <stdio.h>
#include <string>
#include <iostream>
using namespace std;
int main(void) {
static const string message = "mensaje de prueba";
cout << "message = " << message << endl;
return 1;
}
When I use g++ compiler, I just get undefined reference errors.
/var/tmp/cc4QV8B7.o: In function
`std::_Format_cache<char>::_S_get(std::ios_base&)':
/var/tmp/cc4QV8B7.o(.gnu.linkonce.t._ZNSt13_Format_cacheIcE6_S_getERSt8ios_b
ase+0x84): undefined reference to
`std::_Format_cache<char>::_Format_cache()'
/var/tmp/cc4QV8B7.o: In function
`std::_Format_cache<char>::_S_callback(std::ios_base::event, std::ios_base&,
int)':
/var/tmp/cc4QV8B7.o(.gnu.linkonce.t._ZNSt13_Format_cacheIcE11_S_callbackENSt
8ios_base5eventERS1_i+0xe8): undefined reference to
`std::_Format_cache<char>::_Format_cache()'
collect2: ld returned 1 exit status
program versions:
gcc= 3.0.2
Can you help me please.
Thank you
Enrique Muñoz