Jipolie01
Jipolie01

Reputation: 15

Setting up relative path in visual studio for SFML

I'm making a school-project with SFML. One of the requirements for this project is that the game is runable from within our git-repository. So I added the SFML directory in our "game" directory in github.

Now I want to set up a relative path for a project in the same game directory. The problem is that I don't know how many folders my teacher uses in his path, so I can't use "../../../Game/SFML/lib" for example. Do you guys know a way to do this?

I can't seem to find any info on how this is done online or in SFML documentation, but then again I might be super blind.

Upvotes: 1

Views: 354

Answers (1)

Mario
Mario

Reputation: 36537

This is not really SFML related, but you could just use some of the macros exposed by the IDE that will expand to the correct paths.

For example, let's assume you're on your local PC the solution file is C:\School\Project\Project.sln and on your teacher's PC it's on W:\Class 5\Project 4\Project.sln.

If you set your additional library path to $(Solution)SFML\lib Visual Studio will see this as C:\School\Project\SFML\lib, while on your teacher's PC it would result in W:\Class 5\Project 4\SFML\lib.

Upvotes: 1

Related Questions