0

For example I build from source some c++ library and I have folders bin(with .dll files), lib(with .lib files) and include(with .h files).

How can I add this all to system that I can use them just as ordinary system libraries in VS? This means that I don't want to specify inlude dir, addictional libs dir at every new VS project.

mrgloom
  • 20,061
  • 36
  • 171
  • 301
  • 1
    This is generally a very unwise thing to do, you'll end up with "only builds on my machine" projects. Look into use the Property Manager window to create your own property sheets. – Hans Passant Oct 11 '14 at 15:16

2 Answers2

0

You could set the paths globally for Visual Studio. This way, the paths will be "inherited" by all existing and new projects.

Check this article: http://www.curlybrace.com/words/2012/12/17/setting-global-c-include-paths-in-visual-studio-2012-and-2011-and-2010/

VAndrei
  • 5,420
  • 18
  • 43
  • What about additional `.lib` files in linker settings? – ivan_pozdeev Oct 11 '14 at 09:57
  • 1
    @ivan_pozdeev I think they are "Library Directories" – Winestone Oct 11 '14 at 09:58
  • @Winestone Nope. "Library directories" only specifies search paths. The libs to link against need to be specified separately, see http://stackoverflow.com/a/25791001/648265 – ivan_pozdeev Oct 11 '14 at 10:00
  • @ivan_pozdeev Ahh, sorry, misunderstood your question. – Winestone Oct 11 '14 at 10:02
  • 1
    @ivan_pozdeev I don't think it makes sense to add specific .lib includes globally. That MUST be set per project. – VAndrei Oct 11 '14 at 10:02
  • @VAndrei All the standard libs are there by default. OP requires a lib to be available with zero additional configuration. So it makes perfect sense. – ivan_pozdeev Oct 11 '14 at 10:04
  • @ivan_pozdeev I agree that your solution works with zero config and that standard libs are there. But standard libs are there because the program might really need them. While for other custom defined libs there is no point in linking them. – VAndrei Oct 11 '14 at 10:11
0

I have had that problem before...

I wrote a tool named wpkg which allows you to create Debian like packages (it is mostly compatible although wpkg does not support all the Debian features...)

This gives you the ability to very easily manage an environment of any size having many otherwise separate projects. The installation process allows you to put everything under a set of directories and all you have to do is defined the root path in a variable. Then reuse that variable in your VC settings. For example:

PROJECT_ROOT=E:\dev

(in most cases you define that in your environment variables and restart VC so it appears in there!)

Then in VC you'd have things like:

${PROJECT_ROOT}\include
${PROJECT_ROOT}\lib
${PROJECT_ROOT}\bin

The pkg_explorer tool will also help you with a GUI to install, update, and remove packages from your environment.

This is quite useful if you have a team of programmers and you don't want each one to do their own environment setup. The packages is the final setup (only you can install it on any drive you'd like.) It is also intended for end users, although you probably would need some easier interface than pkg_explorer for end users (unless you target programmers.)

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156