-
Notifications
You must be signed in to change notification settings - Fork 914
v2_0_cpp_tutorial
Takatoshi Kondo edited this page Apr 9, 2018
·
12 revisions
msgpack-c is a header only library. You can just add msgpack-c/include to the compiler include path.
g++ -Ipath_to_msgpack-c/include your_source.cpp
In order to use msgpack-c, you need to include msgpack.hpp in your source code.
It is a convenience header file that contains all msgpack-c functionalities.
After include the header file, I recommend checking the version of msgpack-c.
Here is an example:
#include <iostream>
#include <msgpack.hpp>
int main() {
std::cout << MSGPACK_VERSION << std::endl;
}https://wandbox.org/permlink/9g8uhDsVHAW1rpwV
Because some environment often has installed older-version of the msgpack-c in /usr/include. It is very confusing. So I recommend the version of msgpack-c that actually you include.
-
Home
- Q&A
- v2.0.x or later
- v1.1.x - v1.4.x
- v1.0.x