SFML community forums

Help => General => Topic started by: aochrine on August 18, 2016, 03:02:35 am

Title: Cannot compile finished project pulled from GitHub!
Post by: aochrine on August 18, 2016, 03:02:35 am
Hey guys,

So I been working on a space shooter game on one computer and I finished it. I pushed all my work onto Github. Now I want to work a bit more on the game so I cloned my repo from github and opened up the project in Visual Studio. When I try to run the debug, I get "cannot open source file "SFML\Graphics.hpp". Before I compiled, I made sure to go into the project properties and made sure that my project points to the correct sfml include/lib location. I have the right dependencies. I basically did exactly what I did the first time before working on the project and it worked before. The only difference now is that I have the completed projected and then updated the project property whereas before I configured the project property  and then started to work on the project. I'm sure if I just started a new project, configure the project property correctly, and copy paste all my code it would work ... but I don't want to do that! Any fix?

Thanks in advance.

Title: AW: Cannot compile finished project pulled from GitHub!
Post by: eXpl0it3r on August 18, 2016, 04:29:21 pm
So are the paths still set correctly when you open the project? Are you using absolute or relative paths?
Title: Re: Cannot compile finished project pulled from GitHub!
Post by: aochrine on August 18, 2016, 05:57:30 pm
All path are set correctly. I'm using absolute path. For example, went into the sfml include folder and copied the address and it looks like "C:......\SFML...\include"
Title: Re: Cannot compile finished project pulled from GitHub!
Post by: eXpl0it3r on August 18, 2016, 07:47:20 pm
Can you provide the full build command?

And I assume the SFML is still located at the same place where ever you're git cloning the repo?
Title: Re: Cannot compile finished project pulled from GitHub!
Post by: aochrine on August 18, 2016, 08:43:36 pm
Could you clarify what the full build command is?

I have the SFML folder on my desktop and the folder i cloned is also on my desktop (but sfml folder is not in the folder i cloned). When I first cloned the project, the path were pointing to my where SFML folder was on my old computer. I then changed it to point to the right SFML path on my current computer.
Title: Re: Cannot compile finished project pulled from GitHub!
Post by: jamesL on August 18, 2016, 10:58:30 pm
are you sure your "additional includes" in VS are correct ?

go here
http://www.sfml-dev.org/tutorials/2.4/start-vc.php 

and find
The path to the SFML headers (<sfml-install-path>/include) to C/C++ » General » Additional Include Directories
Title: Re: Cannot compile finished project pulled from GitHub!
Post by: aochrine on August 19, 2016, 04:05:11 am
absolutely sure it's correct. I've done it before and it worked, but it's  not working now for some reason. What's weird is that it sometime registers the SFML folder, like if I go to one of my class's header file and type "#include <SFML\Graphics.hpp>" itll work, but when I do the same thing in main it doesn't work ...
Title: Re: Cannot compile finished project pulled from GitHub!
Post by: eXpl0it3r on August 19, 2016, 12:52:08 pm
Make sure you've added all the source files to the project, you need to do that explicitly.
Also make sure to use forward slashes <SFML/Graphics.hpp>.
Title: Re: Cannot compile finished project pulled from GitHub!
Post by: aochrine on August 20, 2016, 08:42:49 pm
By source file do you mean the include and lib folder? Like those folders need to be IN my project folder?
Title: Re: Cannot compile finished project pulled from GitHub!
Post by: aochrine on August 20, 2016, 09:14:03 pm
my project doesn't say "cannot open include file ..." nor does the error say "cannot open include file "SFML....": no such file or directory". The error only says cannot open source file "SFML\Graphics.hpp". I'm going to try using a different version of sfml and see if that works...