donatell0
May 15th, 2008, 09:31 AM
I don't know whats wrong with my installation but I know that STL is installed, as I can compile codes that use vector, string, queue, stack, etc
But this does not compile:
#include <iostream>
#include <hash_map>
using namespace std;
int main() {
hash_map<const char*, int> M;
M["a"] = 2;
cout << M["a"] << endl;
return 0;
}
The errors i get are:
a.cpp:2:20: error: hash_map: No such file or directory
a.cpp: In function ‘int main()’:
a.cpp:7: error: ‘hash_map’ was not declared in this scope
a.cpp:7: error: expected primary-expression before ‘const’
a.cpp:7: error: expected `;' before ‘const’
a.cpp:8: error: ‘M’ was not declared in this scope
make: *** [a] Error 1
But this does not compile:
#include <iostream>
#include <hash_map>
using namespace std;
int main() {
hash_map<const char*, int> M;
M["a"] = 2;
cout << M["a"] << endl;
return 0;
}
The errors i get are:
a.cpp:2:20: error: hash_map: No such file or directory
a.cpp: In function ‘int main()’:
a.cpp:7: error: ‘hash_map’ was not declared in this scope
a.cpp:7: error: expected primary-expression before ‘const’
a.cpp:7: error: expected `;' before ‘const’
a.cpp:8: error: ‘M’ was not declared in this scope
make: *** [a] Error 1