dgcor / DGEngine

An implementation of the Diablo 1 game engine
Other
243 stars 30 forks source link

error: ‘fabsf’ was not declared in this scope #4

Closed mewmew closed 8 years ago

mewmew commented 8 years ago

When compiling rev 40afab360a26f087b2b3e72b8c8f1794e5cb50c2 the following error is reported.

/home/u/Desktop/DGEngine/src/Game/PathFinder.cpp: In member function ‘float MapSearchNode::GoalDistanceEstimate(MapSearchNode&)’:
/home/u/Desktop/DGEngine/src/Game/PathFinder.cpp:20:29: error: ‘fabsf’ was not declared in this scope
  return fabsf(x - nodeGoal.x) + fabsf(y - nodeGoal.y);

This was reported on a system running Arch Linux, with GCC version 6.1.1.

ghost commented 8 years ago

Thank you for reporting this. I compile using 2 different versions of gcc and couldn't reproduce this error, although I don't doubt it happens (gcc is very strict about this and part of the reason why I compile DGEngine against it).

I just fixed this on 8c320b0. I won't use your pull request as I reworked that code to be more C++ (I had copy-pasted it originally from the A* example provided by the implementation I used).

mewmew commented 8 years ago

I just fixed this on 8c320b0. I won't use your pull request as I reworked that code to be more C++ (I had copy-pasted it originally from the A* example provided by the implementation I used).

Hehe, it was a one-liner PR so no worries :) I'll close this issue for now as it has been resolved in rev 8c320b0.