Jump to content

Compile error on linux gcc


Guest ike3

Recommended Posts

/home/ike/playerbot/src/game/ahbot/../../shared/Util.h: In function ‘void strToUpper(std::string&)’:
/home/ike/playerbot/src/game/ahbot/../../shared/Util.h:263: error: no matching function for call to ‘transform(__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, <unresolved overloaded function type>)’
/home/ike/playerbot/src/game/ahbot/../../shared/Util.h: In function ‘void strToLower(std::string&)’:
/home/ike/playerbot/src/game/ahbot/../../shared/Util.h:268: error: no matching function for call to ‘transform(__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, <unresolved overloaded function type>)’

Explicit cast fixes the problem:

std::transform( str.begin(), str.end(), str.begin(), (int(*)(int))toupper );

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use