I'm running CentOS 6.4 and need a later version of the C++ compiler to build my development tools (Qt Creator in this case).
I'm unclear on the implications of using devtools and I'm hoping someone can explain.
- If I compile programs using devtools, does that means the executable will run on other Centos 6.4 installations without change?
- Or..do I know have to ship libraries or other files with my compiled programs?
- If so...do I have to modify my C++ code to reference the later libraries? or is this something done by the person installing my compiled program
I hope this somewhat late answer can still help you. What I found is that compiling my project with
devtoolset
(1.1 in my case, but that should not matter too much) on RHEL 6.4 produces binaries which can almost run on a standard RedHat EL 6.4 (should be similar for Centos 6.4).The only trouble I ran into was compiling my project with
-std=c++11
, which produced some problems due to incompatible symbols. The reason is that the GCC folks considered these parts of the standard library to be experimental in GCC 4.4, so they broke ABI compatibility in some places.Turns out, there's an easy fix: Link your programs with the additional command-line-argument
-static-libstdc++
. That way, the binary becomes a bit larger but is runs on an unmodified RHEL 6.4 without installing additional libraries/updates for thedevtoolset
.To answer your questions explicitly:
-static-libstdc++
when linking.