View Single Post
  #3  
Old 07-16-2009, 03:46 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Awwe, compile error:
Code:
entity.cpp: In member function ‘Object* EntityList::FindNearbyObject(float, float, float, float)’:
entity.cpp:774: error: call of overloaded ‘abs(float)’ is ambiguous
/usr/include/stdlib.h:778: note: candidates are: int abs(int)
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/cstdlib:172: note:                 long long int __gnu_cxx::abs(long long int)
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/cstdlib:142: note:                 long int std::abs(long int)
entity.cpp:774: error: call of overloaded ‘abs(float)’ is ambiguous
/usr/include/stdlib.h:778: note: candidates are: int abs(int)
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/cstdlib:172: note:                 long long int __gnu_cxx::abs(long long int)
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/cstdlib:142: note:                 long int std::abs(long int)
entity.cpp:774: error: call of overloaded ‘abs(float)’ is ambiguous
/usr/include/stdlib.h:778: note: candidates are: int abs(int)
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/cstdlib:172: note:                 long long int __gnu_cxx::abs(long long int)
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/cstdlib:142: note:                 long int std::abs(long int)
Maybe I missed something or messed something up while adjusting the formatting. All I really did was change the double spaces to tabs to make it uniform with the source code. I am going to check it over again and see if I can figure it out. Seems like it should work, since the doors code right above it is almost the exact same thing. BTW, that command in command.cpp is massive!

Here is the bit of code it is referring to:
Code:
	while(iterator.MoreElements())
	{
		Object* object=iterator.GetData();

		object->GetLocation(&ox, &oy, &oz);

		if ((abs(ox - x) <= radius) && (abs(oy - y) <= radius) && (abs(oz - z) <= radius))
		{
			return object;
		}
		iterator.Advance();
	}
Maybe it is just an issue with my libraries or gcc or kernel or something. I don't really know.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote