I encountered a problem with linking and distributing libraries in Visual Studio 2010. What I want to do:
- Link my project with SDL and use its headers
- Keep SDL somewhere in my project directory, so when I clone it from source control on another machine, I won’t have to install any additional library.
My attempts so far:
- Google points to tutorials like this one : Lazy Foo Productions, but it doesn’t do what I want because SDL is placed outside project directory.
- When I copy SDL to solution directory and add it via Project->Properties->Linker…. It works, but project settings now contain absolute path to library directory, so I guess it won’t compile on other machine.
What should I do? SDL is just a example here, I’d like to know how to solve such problem with any library.
You can use
Project->Properties->Linker->General->Additional Library Directoriesto specify new directory where the linker to look up for libraries (it can use relative path)You can use
Project->Properties->C++->General->Additional Include Directoriesto specify where to look for the headers.