jeremyletang / rust-sfml

SFML bindings for Rust
Other
638 stars 88 forks source link

Fatal SYNTAX ERROR while compiling with SFML 2.6. #310

Closed GrimReaper420 closed 1 year ago

GrimReaper420 commented 1 year ago

From 2.5 to 2.6, SFML removed the sf::Window class declaration from the touch.hpp header (see here https://github.com/SFML/SFML/commit/ae337952a98bfb71d228221015c947df94bdd6b4#diff-8add9db5827bc65c2822c8691229648427889f6d9eaf6ad31e9486367b63eb94).

When building the touch.cpp file of rust-sfml v0.20.0 while using SFML 2.6 headers this causes a syntax error.:

CSFML/src/Window/Touch.cpp(13): error C2039: 'Window': is not a member of 'sf' C:\Program Files (x86)\SFML\include\SFML/Window/Touch.hpp(35): note: see declaration of 'sf' CSFML/src/Window/Touch.cpp(13): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int CSFML/src/Window/Touch.cpp(13): error C2143: *syntax error: missing ',' before ''** CSFML/src/Window/Touch.cpp(14): error C2065: 'relativeTo': undeclared identifier exit code: 2

Steps to reproduce:

  1. compile v0.20.0 of rust-sfml using SFML 2.6.x headers

Suggested fix:

The master branch of rust-sfml compiles correctly due to: https://github.com/jeremyletang/rust-sfml/commit/14d9bc2b07af1e342506adeecbacedb16e0e9ba2 So create a new release (0.21.0) of rust-sfml with the current master branch to fix compatibility with SFML 2.6.x.

Thank you.

crumblingstatue commented 1 year ago

I released 0.21.0. Let me know if you have any issues with it!

GrimReaper420 commented 1 year ago

It works perfectly! Thanks.