Search code examples
c++jsoncross-compilingsynology

Cross-compile json-cpp for Synology RS812+


Can anyone tell me how to cross compile json-cpp for Synology?

According to json-cpp README the SContruct shall be updated, which I have done.

I took a copy of the "linux-gcc" platform option, and configured the g++ to /usr/local/i686-linux-gnu/bin/i686-linux-gnu-g++ (downloaded toolchain for RS812). I compiled json-cpp, which seemed to go fine.

I then try to compile a little test cpp, using the following:

/usr/local/i686-linux-gnu/bin/i686-linux-gnu-g++ -Ijsoncpp/include -Ljsoncpp/libs/synology http_test.cpp -ljson

But then I get the following (linker) error:

jsoncpp/libs/synology/libjson.so: undefined reference to `__stack_chk_fail@GLIBC_2.4'

Any inputs on what I'm missing when compiling json-cpp?


Solution

  • This seems to be a generic problem of what to do when __stack_chk_fail is not defined. For that we already have an answer! https://stackoverflow.com/a/4492865/4323