Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/135.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 错误:没有匹配的函数用于调用我的类构造函数_C++_Gcc_Constructor_Compiler Errors - Fatal编程技术网

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*)’|