SFML community forums
Help => General => Topic started by: blodrav3n on September 08, 2023, 01:34:42 pm
-
I am having difficulties to setup the SFML version compiled for Visual C++ 15 (2017)-64bit.
I installed sfml, saved it in a c:\ folder with no spaces.
I created an environment variable and called
SFML_DIR with value C:\something\SFML-2.5.1, then i added %SFML_DIR%\bin to the path variable.
I tried running a project in visual studio 2022 and it appeared:
Severity Code Description Project File Line Suppression State.
Error (active) E1696 cannot open source file "SFML/Graphics.hpp" .
then I tried watching another youtube video and changed the project properties and found problems with the linker.
Linker Tools Error LNK2001
-
Did you follow the official tutorial on how to setup Visual Studio?
https://www.sfml-dev.org/tutorials/2.6/start-vc.php
-
before no, now I tried to follow all the instructions in the tutorial you linked but still I can't, it gives me linking problems. the tutorial shows lib files that are not present in the SFML version compiled for Visual C++ 15 (2017)-64bit such as opengl32.lib.
-
It is presumed that you have OpenGL installed on your device to be able to use OpenGL sections of SFML.
They will likely be installed in somewhere like C:\Windows\System32.
If not, you'll need to install OpenGL drivers for your graphics card.
https://www.khronos.org/opengl/wiki/Getting_Started#Downloading_OpenGL
-
I discovered that I have WinMM.Lib and OpenGL32.Lib and Gdi32.Lib on my computer.
I tried to enter them into the input section of the linker without success. ( I entered:
sfml-window-s.lib
sfml-system-s.lib
openGL32.Lib
freetype.lib
sfml-window-s-d.lib
sfml-system-s-d.lib
WinMM.Lib
sfml-graphics-s.lib
sfml-graphics-s-d.lib
Gdi32.Lib).
Should I create OpenGL Context and load all the necessary functions to use OpenGL?(I installed the recent driver for my graphic card).