C++ 错误:没有匹配的函数用于调用我的类构造函数
我在使用新的类纹理时出现了一个奇怪的错误C++ 错误:没有匹配的函数用于调用我的类构造函数,c++,gcc,constructor,compiler-errors,C++,Gcc,Constructor,Compiler Errors,我在使用新的类纹理时出现了一个奇怪的错误 #include <ImageMagick/Magick++.h> class Texture { public: Texture(GLenum TextureTarget, const std::string& FileName); Texture(GLenum TextureTarget,const Magick::Image* img); 我明白了 您不必指定常量,Magick::Image*在纹理(GL_T
#include <ImageMagick/Magick++.h>
class Texture
{
public:
Texture(GLenum TextureTarget, const std::string& FileName);
Texture(GLenum TextureTarget,const Magick::Image* img);
我明白了
您不必指定常量,Magick::Image*在纹理(GL_Texture_2D,(const Magick::Image*)Image_small)中也可以,这是您仅有的两个构造函数吗?编译器报告候选函数是什么吗?e:候选函数是:。。注意:纹理::纹理(GLenum,const string&)是
GL\u Texture\u 2D
GLenum的成员?在项目中显示GLenum
的定义?当我看到它时,它说typedef unsigned int GLenum代码>,这意味着参数确实匹配。
Magick::Image* image_small =
new Magick::Image( Magick::Geometry(pCodecCtx->width/8,
pCodecCtx->height/8),
Magick::Color(0, 0, 0, 0));
/*135*/ Texture* txtr = new Texture(GL_TEXTURE_2D,
(const Magick::Image*)image_small);
P.cpp|135|error: no matching function for call to ‘Texture::Texture(int, const Magick::Image*)’|