[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

problemi con stdlibc++



ciao a tutti,

sto provando per la prima volta ad usare la libreria standard del c++.
ho installati gcc 3.3 e libstdc++5-3.3.

Nel compilare questo stupidissimo esempio di un libro:

#include <iostream>
#include <stdlib.h>
#include <vector>
#include <string>

int main(int argc, char *argv[])
{
   vector<string> names;
   names.push_back("Tom");
   names.push_back("Dick");
   cout << names[0] << endl;
   cout << names[1] << endl;
   return 0;
}

ottengo i seguenti errori:

main.cpp: In function `int main(int, char**)': 
main.cpp:13: error: `vector' undeclared (first use this function) 
main.cpp:13: error: (Each undeclared identifier is reported only once for each 
function it appears in.) 
main.cpp:13: error: `string' undeclared (first use this function) 
main.cpp:13: error: `names' undeclared (first use this function) 
main.cpp:16: error: `cout' undeclared (first use this function) 
main.cpp:16: error: `endl' undeclared (first use this function) 
main.cpp:12: warning: unused parameter `int argc' 
main.cpp:12: warning: unused parameter `char**argv' 

qualcuno sa spiegarmi come risolvere?

grazie.
Sergio




Reply to: