Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Graphics.hpp Link error  (Read 11343 times)

0 Members and 1 Guest are viewing this topic.

vsehgal1

  • Newbie
  • *
  • Posts: 6
    • View Profile
Graphics.hpp Link error
« 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
« Last Edit: January 09, 2018, 07:30:01 am by vsehgal1 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Graphics.hpp Link error
« Reply #1 on: January 09, 2018, 07:23:37 am »
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
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

vsehgal1

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Graphics.hpp Link error
« Reply #2 on: January 09, 2018, 07:30:42 am »
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?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Graphics.hpp Link error
« Reply #3 on: January 09, 2018, 08:12:25 am »
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>
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

vsehgal1

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Graphics.hpp Link error
« Reply #4 on: January 09, 2018, 08:19:20 am »
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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Graphics.hpp Link error
« Reply #5 on: January 09, 2018, 08:27:42 am »
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.
« Last Edit: January 09, 2018, 08:30:29 am by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

dabbertorres

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • website/blog
Re: Graphics.hpp Link error
« Reply #6 on: January 09, 2018, 04:37:35 pm »
Your image says you've configured for the x64 Platform, are you building for x64, or x86/Win32?

vsehgal1

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Graphics.hpp Link error
« Reply #7 on: January 09, 2018, 07:40:31 pm »
Your image says you've configured for the x64 Platform, are you building for x64, or x86/Win32?

x64. My system is 64 bit

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Graphics.hpp Link error
« Reply #8 on: January 09, 2018, 07:51:50 pm »
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?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

vsehgal1

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Graphics.hpp Link error
« Reply #9 on: January 09, 2018, 11:50:54 pm »
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)?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Graphics.hpp Link error
« Reply #10 on: January 09, 2018, 11:59:30 pm »
Well you configurations obviously have to be made for the compiler you're using. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

vsehgal1

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Graphics.hpp Link error
« Reply #11 on: January 10, 2018, 12:26:49 am »
Well you configurations obviously have to be made for the compiler you're using. ;)
Oh shit thanks a lot it worked!!