The error is:
In function ‘int returnShortestWeightedBranch(std::vector >*)’: error: name lookup of ‘jj’ changed for
False: for(...;...;...;);
for(...;...;...;);
True: for(...;...;...;)
for(...;...;...;)
You shouldn't use a semicolon, ;
;