English 中文(简体)
与MSVC 11(VS 2012)协作
原标题:Boost compiling with MSVC 11 (VS 2012)
最佳回答
问题回答

This answer works beautifully for:

  • VS2012 (Visual Studio 2012 Update 2)
    • or VS2015 (Visual Studio 2015 Update 2)
  • Windows 7 x64
    • or Windows 10 x64
  • Boost v1.53
    • or Boost v1.60

In a nutshell

  1. Open a Visual Studio 2012 command prompt. From the start menu its: All Programs..Microsoft Visual Studio 2012..Visual Studio Tools..x64 Native Tools Command Prompt.
  2. Unzip boost_1_53_0.zip to C:oost153.
  3. run bootstrap.bat
  4. run bjam.exe
  5. In any new C++ project, include the path to the Boost libraries, as per the screenshot below.

http://www.ohchr.org。

  1. Install Visual Studio 2012.
  2. Install Update 2.
  3. Download Boost from SourceForge.
  4. Unzip into "C:oost153"
  5. Open a Visual Studio Command prompt with Administrator privileges. From the start menu, its All Programs..Microsoft Visual Studio 2012..Visual Studio Tools..x64 Native Tools Command Prompt.
  6. Change to the boost directory with cd c:oost153.
  7. Run bootstrap.bat.
  8. Run bjam.exe. This builds all of the libraries.
  9. There may be some warnings, but you can ignore these.
  10. 在大约5分钟后完成编辑工作时,它指出:

    The Boost C++ Libraries were successfully built!
    The following directory should be added to compiler include paths:
       C:/boost153
    The following directory should be added to linker library paths:
       C:oost153stagelib
    
  11. This is important, we will need to add these two paths to any new C++ project.

  12. Create a new C++ project.
  13. As noted a couple of steps ago, add C:/boost153 to the compiler include path and C:oost153stagelib to the linker library path.
  14. Right click on the project, select Properties, select Configuration Properties..VC++ Directories. See the two portions of bolded text in the screenshot below): enter image description here
  15. 让我们实施一个简单的方案,通过增加对<条码><<>foreach的路程:

    // Source code below copied from:   
    // http://www.boost.org/doc/libs/1_53_0/doc/html/foreach.html
    #include "stdafx.h"
    
    #include <string>
    #include <iostream>
    #include <conio.h> // Supports _getch()
    #include <boost/foreach.hpp>
    
    int main()
    {
        std::string hello( "Hello, world!" );
    
        BOOST_FOREACH( char ch, hello )
        {
            std::cout << ch;
        }
    
        _getch();
        return 0;
    }
    
  16. 结果:

    Hello, world!
    

More Answers

Update 2016-05-05

查阅<代码>Win10 x64++Boost v1.6.0

boot。

bjam.exe -toolset=msvc-11

检查你的安装正确无误,确认以下指挥单位的产出:

C:>echo %VS110COMNTOOLS%
C:Program Files (x86)Microsoft Visual Studio 11.0Common7Tools

http://landoftheninja.blogspot.com/201111/udio-c-11-and-boost.html

不要错过其处理自动连接问题的后续员额。

vs2012 ERROR: Cannot决定VS通用工具夹的位置。

vcvarsall.bat need call a "reg.exe" which in "C:windowssystem32". if not in search path,will cause this error.

加上C:Wooowssystem32至 %PATH%将解决这一问题。

除上述答复外,我还发现BlueGo真正有助于与MSVC 10/11/12建立强化版本。 你们可以选择不同的组合,而只是选择建设,而是trick。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签