[Lemon-user] Newbie question on data types for maps
Kovács Péter
kpeter at inf.elte.hu
Wed Nov 17 23:50:49 CET 2010
Dear Clark,
You can use your own classes as item types for maps. The linker error is
most likely due to an improper compilation process. I hope this
documentation helps you:
http://lemon.cs.elte.hu/trac/lemon/wiki/InstallGuide
Best regards,
Peter
> My apologies if this is explained somewhere, but I can’t find it in the
> documentation:
>
> What kinds of data types can be used in maps? I have tried to use my own
> classes with maps, and just get linker errors. Built-in types seem to
> work fine.
>
> For example:
>
> #include<lemon/smart_graph.h>
>
> #include<lemon/concepts/maps.h>
>
> usingnamespace lemon;
>
> structsimple{
>
> int data;
>
> };
>
> intmain(){
>
> SmartGraph a;
>
> SmartGraph::NodeMap<simple> test(a);
>
> return 0;
>
> }
>
> Gives the error:
> 1>main.obj : error LNK2001: unresolved external symbol "struct
> lemon::Invalid const lemon::INVALID" (?INVALID at lemon@@3UInvalid at 1@B)
>
> With Microsoft’s compiler.
>
More information about the Lemon-user
mailing list