I have this code using lodepng library for loading PNG files. Library is OK, succesfully used in other projects, wihout problem.
const std::string tmpString = mapFileName.GetConstString();
std::vector<unsigned char> xx;
unsigned int error = lodepng::decode(xx, (unsigned int)this->mapWidth, (unsigned int)this->mapHeight, tmpString, LCT_GREY, (unsigned int)8);
I want to compile this, but getting weird error message.
MapHelper.cpp(72): error C2665: 'lodepng::decode' : none of the 5 overloads could convert all the argument types
c:\ImageUtils\lodepng.h(200): could be 'unsigned int lodepng::decode(std::vector<_Ty> &,unsigned int &,unsigned int &,const unsigned char *,size_t,LodePNGColorType,unsigned int)'
with
[
_Ty=uint8
]
c:\ImageUtils\lodepng.h(203): or 'unsigned int lodepng::decode(std::vector<_Ty> &,unsigned int &,unsigned int &,const std::vector<_Ty> &,LodePNGColorType,unsigned int)'
with
[
_Ty=uint8
]
c:\ImageUtils\lodepng.h(211): or 'unsigned int lodepng::decode(std::vector<_Ty> &,unsigned int &,unsigned int &,const std::string &,LodePNGColorType,unsigned int)'
with
[
_Ty=uint8
]
c:\ImageUtils\lodepng.h(759): or 'unsigned int lodepng::decode(std::vector<_Ty> &,unsigned int &,unsigned int &,lodepng::State &,const unsigned char *,size_t)'
with
[
_Ty=uint8
]
while trying to match the argument list '(std::vector<_Ty>, unsigned int, unsigned int, const std::string, LodePNGColorType, unsigned int)'
with
[
_Ty=uint8
]
I cant see whats wrong, types of input parametrs are same as in library and there can be no collision in types.
EDIT
Function, where I have lodepng::decode
is not const