Compiler error messages for STL code are awkward. Here is an example:
{} In file included from sim.cpp:5: global.h: In function `void Simulate (int, map<id, Node *, less<Id>, allocator<Node *> >, map<Id, Link *, less<Id>, allocator<Link *> >, map<Id, Veh *, less<Id>, allocator<Veh *> >)': global.h:358: conversion from `Link *' to non-scalar type `Link' requested
It is often helpful to first read the messages item by item and sometimes to re-arrange the messages:
{} In file included from sim.cpp:5:
{} global.h: In function `void simulate (int, map<Id, Node *, less<Id>, allocator<Node *> >, map<Id, Link *, less<Id>, allocator<Link *> >, map<id, Veh *, less<Id>, allocator<Veh *> >)':As long as there is only one function void simulate(...), one can ignore the rest of this part of the error message. If one does not know about function overloading, this should be generically the case.
{} global.h:358: conversion from `Link *' to non-scalar type `Link' requestedThat is, somehow the item on the right is a pointer to link, while the item on the left is a link.
In this case, the offending line was
{} Link link = l->second;The correct line would be
{} Link* link = l->second;