我是LEDA-6.3用户。 编译这个简单代码时出错:
#include <LEDA/core/d_array.h>
#include <iostream>
using namespace std;
main()
{
d_array<string,string> dic;
dic["hello"] = "hallo";
dic["world"] = "Welt";
dic["book"] = "Buch";
dic["key"] = "Schluessel";
string s;
forall_defined(s,dic) cout << s << " " << dic[s] << endl;
}
G ++编译器:
g++ -I$LEDAROOT/incl -L$LEDAROOT d_array.cpp /usr/lib/LEDA/libleda.a -lX11 -lm -o d_array
错误:
d_array.cpp: In function ‘int main()’: d_array.cpp:8: error: ‘d_array’ was not declared in this scope d_array.cpp:8: error: expected primary-expression before ‘,’ token d_array.cpp:8: error: expected primary-expression before ‘>’ token d_array.cpp:8: error: ‘dic’ was not declared in this scope
如果有LEDA-6.3的指南,请给我链接
答案 0 :(得分:0)
您可能意味着leda::d_array
或忘记了using namespace leda;