SFML community forums
Help => General => Topic started by: vsehgal1 on January 09, 2018, 07:02:04 am
-
Error - "Cannot open source file "SFML/Graphics.hpp""
I'm really sorry if this question is repetitive but I've tried everything and I'm not able to find a fix. I'm using SFML 2.4.2 and Visual Studio Community 2017 ver 15.5.2
I've followed the instructions given here https://www.sfml-dev.org/tutorials/2.0/start-vc.php step by step and have cross checked it quite a few times but I still am not able to figure out whats wrong. :'(
Screenshot - https://imgur.com/a/pZNl6
-
Screenshot doesn't exist.
If it can't find the header, it either doesn't exist in the specuified include directory or you didn't add the include directory to the Additional Include Directories
-
Screenshot doesn't exist.
If it can't find the header, it either doesn't exist in the specuified include directory or you didn't add the include directory to the Additional Include Directories
Sorry about that! Try now?
-
As shown in the tutorial it should just be the include directory without the SFML directory, as you specify that at include.
<Path to SFML root>\include
#include <SFML/Graphics hpp>
-
As shown in the tutorial it should just be the include directory without the SFML directory, as you specify that at include.
<Path to SFML root>\include
#include <SFML/Graphics hpp>
Tried that, still ain't working.
-
So the Additional Include Directories just contains C:\Users\Vikram Sehgal\Documents\CS\C++\SFML-2.4.2\include
If so, then it has to find it.
Are you certain that's the correct path? When you open cmd and just do cd <path> does it navigate to the wanted directory?
On another note, you shouldn't have the library files specified for All Configurations, as debug (with -d suffix) and release (without suffix) require different binaries.
-
Your image says you've configured for the x64 Platform, are you building for x64, or x86/Win32?
-
Your image says you've configured for the x64 Platform, are you building for x64, or x86/Win32?
x64. My system is 64 bit
-
Whether your system is 64 bit or not has nothing to do whether you selected the x64 compiler or the Win32/x86 compiler, so did you?
-
Whether your system is 64 bit or not has nothing to do whether you selected the x64 compiler or the Win32/x86 compiler, so did you?
The compiler is 32bit. So should I change the platform to Activ(Win32)?
-
Well you configurations obviously have to be made for the compiler you're using. ;)
-
Well you configurations obviously have to be made for the compiler you're using. ;)
Oh shit thanks a lot it worked!!