I have an old C code that I would like to combine with some C ++ code.
The C code used has the following meanings:
#include <windows.h> #include <stdio.h> #include <string.h> #include "mysql.h"
Now I am trying to use C ++ with iostream as follows:
#include <windows.h> #include <stdio.h> #include <string> #include <iostream> #include "mysql.h"
But I keep getting the following linker errors when compiling:
[Linker error] undefined reference to `std :: string :: size () const '
[Linker error] undefined reference to `std :: string :: operator [] (unsigned int) const '
[Linker error] undefined reference to `std :: string :: operator [] (unsigned int) const '
[Linker error] undefined reference to `std :: string :: operator [] (unsigned int) const '
[Linker error] undefined reference to `std :: ios_base :: Init :: Init () '
[Linker error] undefined reference to `std :: ios_base :: Init :: ~ Init () '
ld returned 1 exit status
How to resolve this?
Edit: My compiler is Dev-C ++ 4.9.9.2
c ++ c iostream linker
Steve Nov 05 '08 at 0:58 2008-11-05 00:58
source share