I’ve been struggling with a linker error that i cant seem to figure out,
I’m implementing the bellman ford algorithm as a part of my homework.
Here’s the code i’ve written so far,
it’d be great if someone could explain why i’m getting that error,
I’ve pasted my code on mozilla pastebin, the two files are
graph.h : http://pastebin.mozilla.org/1193147
and bellman_ford.cpp : http://pastebin.mozilla.org/1193148
All solutions will be most appreciated and thanks to people for taking out their valuable time to help me out.
You didn’t implement
Vertex::Vertex()orEdge::Edge()– they’re only declared.Implement them like this:
You’ll also get errors if you include
graph.hfrom more than one cpp file. You should move the bodies of your member functions into agraph.cppfile instead of implementing them in the header the way you do.