Running a program made up of clang + llvm on another machine

I am compiling a program via clang + llvm (version 3.1) and trying to run it on a computer that also has the same clang + llvm version. I am going on Ubuntu 10, but the other computer where I am trying to run has CentOS 5. There (on CentOS) I also run into problems compiling via LLVM (compiler run is implemented in LLVM). That's why I thought of compiling on Ubuntu, grab the exe from there and just run it on the CentOS machine.

However, when I try to do this, I get the following error.

./main: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by ./main)
./main: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by ./main)

      

How can I solve this. Please note that I do not have root access on this machine.

+3


source to share


3 answers


One solution would be to copy the library from your Ubuntu work machine to your CentOS machine. Place in your Home / Workdir / whereever (TM) and set the LD_PRELOAD variable to this library. But this can be quite tedious as it is possible that this is not the only library that is missing (and it is possible that the libraries depend on other libraries that you need as well ...).



This also works if both machines are of the same architecture (for example, it won't work if your computer is 32 bit ubuntu and your CentOS 64).

+3


source


Centos 5 uses an older version of libstdC ++ than Ubuntu 11.04 or 11.10, so it cannot use binaries.



Either compile on Centos 5 or find an older compilation environment that works. If you've used gcc, you can also explore the LSB compiler environment.

+2


source


Cross-compiling is always a tricky problem. In your case, you have different versions of a C ++ library on two machines. If you don't need to do this often, I suggest you try and solve the compilation problem on CentOS. This is probably the easier route.

+1


source







All Articles