- 论坛徽章:
- 0
|
困扰了,怎么弄才能让arm-linux-gcc 支持stl 呢
我用写了一个程序,用g++ 能够编译通过,具体程序如下,我需要将此程序放在arm 中跑,需要添加什么呢
程序如下:
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
using namespace std;
int main()
{
multimap<const char*, int> m;
m.insert(pair<const char* const, int>("a", 1));
m.insert(pair<const char* const, int>("c", 2));
m.insert(pair<const char* const, int>("b", 3));
m.insert(pair<const char* const, int>("b", 4));
m.insert(pair<const char* const, int>("a", 5));
m.insert(pair<const char* const, int>("b", 6));
cout << "Number of elements with key a: " << m.count("a") << endl;
cout << "Number of elements with key b: " << m.count("b") << endl;
cout << "Number of elements with key c: " << m.count("c") << endl;
cout << "Number of elements without:"<< m.count("vv")<<endl;
cout << "Elements in m: " << endl;
for (multimap<const char*, int>::iterator it = m.begin();
it != m.end();
++it)
cout << " [" << (*it).first << ", " << (*it).second << "]" << endl;
} |
|