Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/148.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用c++进行LEDA编程:_C++_Ubuntu 10.10 - Fatal编程技术网

用c++进行LEDA编程:

用c++进行LEDA编程:,c++,ubuntu-10.10,C++,Ubuntu 10.10,我是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"]

我是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的指南,请给我链接

你可能是指LEDA::d_数组,或者忘记使用名称空间LEDA

我尝试了leda:d_数组,还使用了名称空间leda;但是还有其他一些大错误,比如us:d_array.cpp:7:error:对“string”的引用是不明确的/usr/lib/LEDA/incl/LEDA/core/string.h:58:error:候选者是:class-LEDA::string和许多其他非组织化的错误议论我现在不知道在这个平台上怎么做!这就是为什么使用被认为是邪恶的!