Download the latest version from the https://github.com/NetEase/libpomelo, decompress it, and go to the directory to compile the static library
./pomelo_gyp -DTO=ios./build_ios./build_iossim
Generate static libraries for ios devices (arm) and ios virtual machines (i386) respectively, and package the two libraries together with lipo:
lipo -create ./build/Default-iphoneos/libpomelo.a ./build/Default-iphonesimulator/libpomelo.a -output libpomelo.alipo -create ./deps/jansson/build/Default-iphoneos/libjansson.a ./deps/jansson/build/Default-iphonesimulator/libjansson.a -output libjansson.alipo -create ./deps/uv/build/Default-iphoneos/libuv.a ./deps/uv/build/Default-iphonesimulator/libuv.a -output libuv.a
Open the cocos2d-x project in xcode and add the three. a static library files generated in project target Build Phases to "Link Binary With Libraries;
Add three directories to "Header Search Paths" in "Build Settings:
Libpomelo/include
Libpomelo/deps/jansson/src
Libpomelo/deps/uv/include
Note the absolute and relative locations of directories.
In this way, you can call the libpomelo static library in both the real machine and simulator.
(To facilitate project sharing, you can copy both the. a static library file and the. h header file to the libs/libpomelo project)
Post: http://blog.csdn.net/aryang/article/details/8875603