This document describes the migration from Boost libraries to standalone Asio and standard C++ libraries.
The following changes were made to remove Boost dependencies:
- boost::asio → standalone asio (version 1.28.0)
- boost::filesystem → std::filesystem (C++17)
- boost::system::error_code → std::error_code
- boost::posix_time → std::chrono
- All
#include <boost/asio/...>replaced with#include <asio/...> - Added
#define ASIO_STANDALONEbefore including asio headers - All
#include <boost/filesystem.hpp>replaced with#include <filesystem> - Namespace changes:
boost::asio→asio,boost::filesystem→std::filesystem - Time handling:
boost::posix_time::seconds→std::chrono::seconds
- All Visual Studio project files updated to:
- Use
$(SolutionDir)External\asio\includeinstead of boost include paths - Remove boost library dependencies
- Add
ASIO_STANDALONEpreprocessor definition - Set C++ language standard to C++17 (required for std::filesystem)
- Use
- Standalone Asio 1.28.0 is now located at:
External/asio/ - No external Boost libraries are required
- Visual Studio 2019 or later
- Windows SDK with C++17 support
- Open
BindstoneClient.slnin Visual Studio - Ensure the configuration is set to your desired platform (x64/x86) and build type (Debug/Release)
- Build the solution (Ctrl+Shift+B or Build → Build Solution)
- If you encounter errors about missing asio headers, ensure the
External/asiofolder exists - If you get C++ standard errors, verify that project files have
<LanguageStandard>stdcpp17</LanguageStandard> - For any remaining boost references in your code, replace them with their standard library equivalents
To verify the migration was successful:
- Search for any remaining "boost::" references in the codebase
- Ensure no
#include <boost/...>statements remain - Verify all projects build successfully without boost libraries