Hi Dat,
As WebSocket++ is a header only library there isn’t much to do. The key things are:
1. Add WebSocket++ headers (the `websocketpp` folder inside the git repo) and any required third party libraries to the header include path.
2. Pass any required third party libraries to the linker
3. Describe the C++11 related features of your compiler to the library
For #1 you can either add the library headers to one of the built in system paths (such as /usr/local/include/) or use the XCode Build Settings -> Search paths -> Header Search Paths setting.
For #2 you can add libraries using the Build Phases -> Link Binary With Libraries option.
For #3 I would recommend the following build settings:
C++ Language Dialect: C++11 or GNU++11
Preprocessor Macros: _WEBSOCKETPP_CPP11_STL_
This will enable all C++11 library features. They are all supported by any recent version of XCode.
*Determining which third party libraries to use*
*Getting the right boost libraries*
Any boost libraries will need to be compiled using the same C++ standard library that your WebSocket++ program is using. The XCode default is LLVM’s libc++ which is not the default. The following terminal commands will build boost from source using clang/libc++ to match the compiler/library used by XCode.
# download and uncompress the latest version of boost (1.55 as of today)
# change to the newly downloaded directory
./booststrap.sh
./b2 toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++"
Optionally: `sudo ./b2 install` to install the library in default system directories. If you don’t do this you’ll need to add boost headers to the search path manually as described above.
Best,
Peter
Hi Peter,
I found your email as the contact info for Zaphoyd Studio. I'm looking for instruction to setup Xcode on Mac OS 10.7 (or 10.8) to work with WebSocket++, but couldn't find any. This instruction for Ubuntu is awesome:
https://github.com/zaphoyd/websocketpp/wiki/Setup-0.3X-on-Ubuntu-12.10,
so I'm wondering if setting up Xcode is too trivia that there's no instruction.
Thanks,
Dat