Boost linking, Visual Studio & version control

后端 未结 5 1687
南方客
南方客 2021-01-18 23:19

I\'m using Visual Studio 2008, and writing some stuff in C++. I\'m using a Boost library (that is not header only).

So, linking to Boost requires one to add

相关标签:
5条回答
  • 2021-01-18 23:59

    I use the BOOST_ROOT environment variable for some stuff, and it works OK. You have to manually create it, and then set the paths in the project files as "$(BOOST_ROOT)\include" and "$(BOOST_ROOT)\lib" (or whatever your layout uses). Everyone then has to set BOOST_ROOT on their machines to point to their Boost install.

    0 讨论(0)
  • 2021-01-19 00:02

    Adding the Boost paths to "Visual C++ Directories" should work. You should add include path <Full path here>\boost_1_39_0 (no boost at the end)
    and library path <Full path here>\boost_1_39_0\bin.v2\lib (bin.v2 is a stage dir that could be different in you case).

    Personally, I store boost sources in my source control and use relative paths in project settings.

    0 讨论(0)
  • 2021-01-19 00:04

    We use a repository containing 3rd party libraries, then use svn:externals to checkout the required parts into the project's base directory, finally use relative paths for additional include and library directories in the project file. Works well, only disadvantage is that you can end up with several boost copies on your harddisk. Using junctions (Windows' version of symbolic links for directories only, works at least from Win2k on, not sure about NT) you can get rid of the wasted space.

    0 讨论(0)
  • 2021-01-19 00:04

    We put all our 3rdparty headers and libraries used by a project in the project tree in source control. This means we track the version of the libraries with the source.

    Then we reference the include and source directories in the project properties. We do not use the Visual C++ Directories as this puts too much dependence on the location of files on different developers systems and also the versions of libraries cannot be tracked.

    The only exception to this would be the platform sdk when developing with vc6.

    Shameless plug: We now manage our vc project settings with CMake and it make these things much easier esp for large projects.

    0 讨论(0)
  • 2021-01-19 00:13

    You tell VS about Boost in a per-computer fashion, not a per-project fashion. Just like directx and other libraries that are not project specific. We think it's reasonable to assume that boost is used in more than one project.

    We don't track external library source in our project SCM unless we're intimate with the implementation details (patching it or whatever). For boost, directx, windows sdk, we just require you to run the respective installer and set the VC++ Directories when you set up your dev environment.

    0 讨论(0)
提交回复
热议问题