[英]Member reference base type is not a structure or union
I need your help on one of my C++ project. 我需要我的C ++项目之一的帮助。 I've got a semantic issue there :
我那里有一个语义问题:
Image bwImage(Image);
bwImage.setPixel(i,j,Color::Color( image.getPixel(i,j).r * RED + image.getPixel(i,j).g*GREEN + image.getPixel(i,j).b*BLUE,
image.getPixel(i,j).r*RED + image.getPixel(i,j).g*GREEN + image.getPixel(i,j).b*BLUE,
image.getPixel(i,j).r*RED + image.getPixel(i,j).g*GREEN + image.getPixel(i,j).b*BLUE) );
The error message is: 错误消息是:
"Member reference base type
sf::Image(sf::Image)
is not a structure or union".“成员引用基本类型
sf::Image(sf::Image)
不是结构或联合”。
Does anyone know where is the problem ? 有人知道问题出在哪里吗?
Thanks ! 谢谢 !
C++ is case sensitive. C ++区分大小写。
Image
is the class name, while image
is your object that instanciate the class. Image
是类名,而image
是实例化该类的对象。
From this Documentation , sf::Image
has a copy constructor: 从本文档中 ,
sf::Image
具有副本构造函数:
sf::Image::Image ( const Image & Copy )
You can build the bwImage
, using that copy constructor, passing a reference to your image
object. 您可以使用该复制构造函数构建
bwImage
,并将引用传递给您的image
对象。
So first line: 所以第一行:
Image bwImage(Image);
Should be: 应该:
Image bwImage(image);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.