- Install boost, see Boost setup section.
- Use
git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.gitto clone your local repo. - Run
cmake -DBOOST_ROOT:STRING=<your boost install folder> -DBOOST_VER:STRING=<your boost version> ./ - Run
make install(if makefile generated) or open generated project (if project file generated) to build. - Outputs is under
./build, link with the all static libs under./build/liband include headers under./build/includein your client code where you want to use it.
- If you're using boost without install,you can specify
boost include dirandboost lib dirseparately by:
cmake
-DBOOST_INCLUDEDIR=<your boost include folder>
-DBOOST_LIBRARYDIR=<your boost lib folder>
-DBOOST_VER:STRING=<your boost version>
./- CMake didn't allow merging static libraries,but they're all copied to
./build/lib, you can DIY if you like.
- Install boost, see Boost setup section.
- Use
git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.gitto clone your local repo. - Add
<your boost install folder>/include,./lib/websocketppand./lib/rapidjson/includeto headers search path. - Include all files under
./srcin your project, addsio_client.cpp,sio_socket.cpp,internal/sio_client_impl.cpp,internal/sio_packet.cppto source list. - Add
<your boost install folder>/libto library search path, addboost.lib(Win32) or-lboost(Other) link option. - Include
sio_client.hin your client code where you want to use it.
- Download boost from boost.org.
- Unpack boost to some place.
- Run either .\bootstrap.bat (on Windows), or ./bootstrap.sh (on other operating systems) under boost folder.
Windows (or other mainstream desktop platforms shall work too):
The following script will build the necessary subset:
bjam install --prefix="<your boost install folder>" --with-system --with-date_time --with-random link=static runtime-link=shared threading=multiOptionally You can merge all output .lib files into a fat one, especially if you're not using cmake.
In output folder, run:
lib.exe /OUT:boost.lib *