According to this page, using Asio without Boost should be fairly straightforward, but I still cannot compile any file with an include
that looks like any of these:
#include <asio>
#include <asio.hpp>
#include <asio/version.hpp>
I have set my compiler to use c++11 (which it was already doing, though I did switch from gnu++11
to c++11
), and I have placed #define ASIO_STANDALONE
before the various includes I am trying.
Is there some extra work necessary for accessing c++11 Asio headers beyond this? I just get file not found
errors during compilation with any of the above attempts.
Asio can be used without Boost if the following conditions are met:
-std=c++11
flag. For Xcode set the C++ language dialect to C++11 or later in project settings-I/path/to/asio
or place the Asio headers in /use/local/include. Xcode will also read /usr/local/include or you can specify a custom header path in the header search paths section of your project config.#define ASIO_STANDALONE
before including Asio headers. This define tells Asio to use the C++11 standard library features for things like error codes, shared pointers, etc rather than using Boost's polyfills.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With