1
General / Re: fatal error: SFML/Graphics.hpp: No such file or directory
« on: December 04, 2023, 09:57:27 pm »
Hi !
Many thanks for your help !
I had to do the following:
- include the following line into the CMakeLists.txt file:
add_subdirectory("build/_deps/sfml-src/include/SFML")
- include the following line into the main.cpp and plots.cpp files:
#include "build/_deps/sfml-src/include/SFML/Graphics.hpp"
- create a new CMakeLists.txt in the build\_deps\sfml-src\include\SFML subdirectory, this file containing:
target_sources(MySFMLFirstProject PRIVATE
Graphics.hpp
)
I wouldn' t have guessed this in the first place !
The last point was found thanks to a new error message appearing during CMake configuration asking for a CMakeLists.txt file into this subdirectory, which I created successfully by looking at other examples of CMakeLists.txt files.
Many thanks again !
Many thanks for your help !
I had to do the following:
- include the following line into the CMakeLists.txt file:
add_subdirectory("build/_deps/sfml-src/include/SFML")
- include the following line into the main.cpp and plots.cpp files:
#include "build/_deps/sfml-src/include/SFML/Graphics.hpp"
- create a new CMakeLists.txt in the build\_deps\sfml-src\include\SFML subdirectory, this file containing:
target_sources(MySFMLFirstProject PRIVATE
Graphics.hpp
)
I wouldn' t have guessed this in the first place !
The last point was found thanks to a new error message appearing during CMake configuration asking for a CMakeLists.txt file into this subdirectory, which I created successfully by looking at other examples of CMakeLists.txt files.
Many thanks again !