I built boost 1.54.0 with Visual Studio 2012 x64.
I tried to build a small demo that is using boost filesystem:
#include <iostream>
#include <boost/filesystem.hpp>
using namespace boost::filesystem;
int main(int argc, char* argv[])
{
if (argc < 2)
{
std::cout << "Usage: tut1 path\n";
return 1;
}
std::cout << argv[1] << " " << file_size(argv[1]) << '\n';
return 0;
}
CMake is used to setup the corresponding project for VS2012 x64:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)
PROJECT(FilesystemTest)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/build/)
# Visual Studio 2010 Pro Standard: /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR
SET(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /W4 /Zi /EHsc /GR- /MP /openmp")
SET(CMAKE_DEBUG_POSTFIX "d")
FIND_PACKAGE(Boost COMPONENTS filesystem system REQUIRED)
# Unicode rules!
ADD_DEFINITIONS(-D_UNICODE)
include_directories(${Boost_INCLUDE_DIR})
LINK_DIRECTORIES( ${Boost_LIBRARY_DIRS} )
file(GLOB FilesystemTest_SOURCES src/*.*)
# Create a target for the library
ADD_EXECUTABLE(FilesystemTest
${FilesystemTest_SOURCES})
But when compiling I get 'libboost_filesystem-vc110-mt-gd-1_54.lib' is missing.
Perviously I used boost 1.53.0 - everything was working perfect when using boost 1.53.0.
When looking into the boost 1.54 lib folder there is only a 'boost_filesystem-vc110-mt-gd-1_54.lib' and a 'libboost_filesystem-vc110-mt-sgd-1_54.lib'
I compiled boost using this instructions:
- Download boost 1.54.0 from http://www.boost.org/
- Extract files (e.g. “C:\thirdparty\vs2013\x64\boost_1_54_0”)
- Start Visual Studio 2012 x64 command prompt
- Change to boost directory (e.g. “cd C:\thirdparty\vs2010\x64\boost_1_54_0”)
- Execute .\bootstrap.bat
- Execute b2 address-model=64 toolset=msvc-11.0 --build-type=complete stage
If only certain libraries (for instance filesystem) are need step 6 can be replaced by this:
b2 address-model=64 toolset=msvc-11.0 --build-type=complete stage --with-filesystem --with-signals --with-system
I could not figure out what is working wrong. Any ideas?
Update Yesterday I tried again: I used the same commands and I finally got a 'libboost_filesystem-vc110-mt-gd-1_54.lib' file. No idea why it is working now. I installed a few VS2012 updates and also removed my VS2013 Preview installation. But I have no clue why it is working now.