tmxlite icon indicating copy to clipboard operation
tmxlite copied to clipboard

Compiler error on SFMLOrthogonalLayer.hpp

Open rohanharikr opened this issue 3 years ago • 4 comments

Is it just me or is anyone else experiencing this issue? I'm on VS 19 Community Edition.

Severity	Code	Description	Project	File	Line	Suppression State	Detail Description
Error (active)	E0349	no operator "==" matches these operands	tmxlite_test	C:\Users\Rohan\source\repos\tmxlite_test\MapLayer.h	141
operand types are: const tmx::Tileset::Tile::Animation::Frame == tmx::Tileset::Tile::Animation::Frame


Severity	Code	Description	Project	File	Line	Suppression State
Error	C2678	binary '==': no operator found which takes a left-hand operand of type 'const tmx::Tileset::Tile::Animation::Frame' (or there is no acceptable conversion)	tmxlite_test	C:\Users\rohanharikr\source\repos\tmxlite_test\MapLayer.h	141	

rohanharikr avatar Sep 11 '21 20:09 rohanharikr

It appears the compiler is complaining about a non-const reference in the comparison, but I don't understand exactly why. The animation operator here is defined with a const reference as per CPP Reference. Could you share some of your code or maybe explain a bit more about what you're doing so I can try and recreate the problem?

fallahn avatar Sep 12 '21 19:09 fallahn

Thanks for the response @fallahn. I didn't write any code, just opened up your SFML example in VS. Not sure if the following information might be helpful, but I added tmxlite and SFML with vcpkg targeting 32 bit.

rohanharikr avatar Sep 13 '21 20:09 rohanharikr

OK thanks, I'll take a look when I can.

fallahn avatar Sep 14 '21 09:09 fallahn

A small update: I've tried building the SFML example as included with the Visual Studio solution in the repository and it seems to work OK. I'm not familiar with vcpkg, so maybe it's an issue with version mismatch? Could you perhaps try cloning the repository and build the current revision to see if the problem exists? Thanks!

fallahn avatar Sep 20 '21 08:09 fallahn