0

I am a LEDA-6.3 user. I have an error when compiling this simple code:

#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++ Compiler:

g++  -I$LEDAROOT/incl -L$LEDAROOT d_array.cpp /usr/lib/LEDA/libleda.a -lX11 -lm -o d_array

The ERROR:

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

Please if there is a guide for LEDA-6.3 give me the link

GSerg
  • 76,472
  • 17
  • 159
  • 346
Kamel
  • 11
  • 2

1 Answers1

0

You probably mean leda::d_array or are forgetting using namespace leda;

tc.
  • 33,468
  • 5
  • 78
  • 96
  • i tried the leda:d_array and also using namespace leda; but there are big others errors such us: d_array.cpp:7: error: reference to ‘string’is ambiguous /usr/lib/LEDA/incl/LEDA/core/string.h:58: error: candidates are: class leda::string and many others errors – Kamel Jun 19 '11 at 14:28
  • SORRY for the non-organisation of the comment. I don't now how doing it in this plat-form! – Kamel Jun 19 '11 at 14:34
  • And that's why `using` is considered evil! – tc. Jun 19 '11 at 15:06