jeremyletang / rust-sfml

SFML bindings for Rust
Other
638 stars 88 forks source link

Can't compile 0.17.0 Missing clock.hpp #289

Closed MyUsernamee closed 2 years ago

MyUsernamee commented 2 years ago

Trying to use 0.17.0 rust-sfml on my windows installation results g++ compilation error.

running: "g++.exe" "-O3" "-ffunction-sections" "-fdata-sections" "-m64" "-I" "CSFML/src/" "-Wall" "-Wextra" "--std=c++17" "-DCSFML_SYSTEM_EXPORTS" "-DCSFML_AUDIO_EXPORTS" "-DCSFML_WINDOW_EXPORTS" "-DCSFML_GRAPHICS_EXPORTS" "-o" "C:\\Users\\dihydromonoxide\\Desktop\\Rust Programs\\rng-dungeon-crawler\\target\\release\\build\\sfml-88964b3a0ea67d1d\\out\\CSFML/src/System/Clock.o" "-c" "CSFML/src/System/Clock.cpp"
  cargo:warning=CSFML/src/System/Clock.cpp:26:10: fatal error: SFML/System/Clock.hpp: No such file or directory
  cargo:warning=   26 | #include <SFML/System/Clock.hpp>
  cargo:warning=      |          ^~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=compilation terminated.
  exit code: 1

  --- stderr

Rust was downloaded through rustup and I have placed the csfml and sfml libs and dlls in the .rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\lib and .rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\bin folders.

0.16.0 Compiles with 0.17.0 does not.

Any help is much appreciated! Thank you so much in advance! :)

crumblingstatue commented 2 years ago

Hi, you need to set two environment variables:

  1. SFML_INCLUDE_DIR to the include directory of your your SFML download
  2. SFML_LIBS_DIR to the lib directory of your SFML download
MyUsernamee commented 2 years ago

That worked! Thank you so much! 😅