c++ - Cross compile on Fedora 18 for Centos 6.4 -


i working on project, uses classes c++11 standard, on fedora 18 machine , want deploy on centos 6.4 server.

i able resolve loader errors except libc , libc++ versions, glibc_2.11, glibcxx_3.4.15 , on fedora machine glibc_2.14 , @ least glibcxx_3.4.17 respectively.

is possible tell compiler compile/link server versions or older compatible versions of libraries?

when run ldd executable

./executable: /lib64/libc.so.6: version `glibc_2.14' not found (required ./executable) ./executable: /usr/lib64/libstdc++.so.6: version `glibcxx_3.4.15' not found (required ./executable) 

thanks in advance!

instead of manually copying libraries separate directory set chroot contaiing centos build env, using mock , epel-6-x86_64 config.

use yum in mock chroot install packages want (e.g. qt) , build in there, ensure code uses centos 6 libs installed in chroot, not rest of packages on fedora os.

update:

when i'm using mock chroot building gcc this:

# need these steps once setup chroot mock -r fedora-19-x86_64 --init mock -r fedora-19-x86_64 --install yum mock -r fedora-19-x86_64 --shell 'mkdir -p /builddir/gcc/src /builddir/gcc/build' su -c 'mount --bind $path_to_gcc_sources /var/lib/mock/fedora-19-x86_64/root/builddir/gcc/src' # enter root password mock -r fedora-19-x86_64 --shell # in chroot yum install gmp-devel mpfr-devel libmpc-devel flex autogen su - mockbuild cd gcc/build ../src/configure --prefix=/builddir/gcc/install ... etc. ... 

for purpose you'd replace fedora-19 epel-6

the bind mount means don't need have gcc sources in chroot, can use existing copy in normal filesystem. see http://gcc.gnu.org/wiki/installinggcc info on building gcc

once install gcc in chroot can use build own programs package them centos.

to go chroot again later:

mock -r fedora-19-x86_64 --shell su - mockbuild 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -