mirror of
https://github.com/socketio/socket.io-client-cpp.git
synced 2025-12-06 06:35:57 +00:00
2.1 KiB
2.1 KiB
Install
With CMake
- Use
git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.gitto clone your local repo. - Run
cmake ./ - 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.
Without CMake
- Use
git clone --recurse-submodules https://github.com/socketio/socket.io-client-cpp.gitto clone your local repo. - Add
./lib/asio/asio/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
BOOST_DATE_TIME_NO_LIB,BOOST_REGEX_NO_LIB,ASIO_STANDALONE,_WEBSOCKETPP_CPP11_STL_and_WEBSOCKETPP_CPP11_FUNCTIONAL_to the preprocessor definitions - Include
sio_client.hin your client code where you want to use it.
With vcpkg
You can download and install the Socket.IO C++ client using the vcpkg dependency manager:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install socket-io-client
The Socket.IO client port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.
With Conan
You can install pre-built binaries for Socket.IO C++ client or build it from source using Conan. Use the following command:
conan install --requires="sioclient/[*]" --build=missing
The Socket.IO client Conan recipe is kept up to date by Conan maintainers and community contributors. If the version is out of date, please create an issue or pull request on the ConanCenterIndex repository.