Unable to open file "Libboost_thread-vc120-mt-gd-1_58.lib solution
1. To the website download the latest boost,www.boost.org here i download the 1-58 version
2. Decompression
3. Open the VS visual Studio Tools from the Start menu and select the X86 command prompt (the sense should also be available with Dos)
4. To extract the directory, for example, I extract to D disk, then enter D disk, into the Boost_1_58_0 directory, and then run the Bootstrap.bat file. Just wait a little while, OK.
5. The Bjam.exe file will be generated at this point in the folder. Use this tool to compile the boost library. According to the online VS2013 to specify the type of output library, a Lib file is missing.
The compilation commands for dynamic and static libraries are as follows:
If you want to get a dynamic library:
Bjam Install stage--toolset=msvc-12.0--stagedir= "C:\Boost\boost_vc_120"
link=shared runtime-link=shared threading=multi Debug Release
If you want to obtain a static library:
Bjam Install stage--toolset=msvc-12.0--stagedir= "C:\Boost\boost_vc_120"
Link=static runtime-link=static threading=multi Debug Release
Here I choose the static library, of course, can choose more according to their own requirements. Continue to execute this compilation command just under the command line. It takes about 30 minutes. According to the computer configuration, too low may take an hour. Then wait for the compilation to complete.
6. When the compilation is complete, copy the boost library above in C disk to any location for use. For example, I'm handcuffed to a D-plate.
7. Include include and Lib in vs. Add directories to the C + + general and connectors.
8. You can use boost.
#include "stdafx.h"
#include <iostream>
#include <boost/thread/thread.hpp>
void Hello ()
{
std::cout << "Hello World, I ' m a thread!" << Std::endl;
}
int main ()
{
boost::thread thrd (&hello);
Thrd.join ();
}
Unable to open file ' Libboost_thread-vc120-mt-gd-1_58.lib
Error.
Think about, just say, multithreading.
Solution:
Change MDD to MTD. Go and run it again. It's OK.
Note:
1>-Generated file name
Libboost_log-vc120-mt-sgd-1_58.lib, where Mt represents multithreading, and s in SGD means that runtime is the STATIC,GD represents the debug version.
2> Add the generated Lib and header files to the VC directory
You will need Lib, such as Boost_1_58_0\lib\vc12_x64\lib, below the Lib directory