Lambda expressions are not easy to love you. STL provides us with a lotAlgorithmIt is a sin to provide anonymous functions!
The story of this article begins.
C ++ 0x brings us a spring breeze and provides lambda expressions. We can finally write data like C #.Program.
Int A, B;
For_each (V. Begin (), V. End (), [=] (Int & IT) {It = It * A + B ;});
Because it is developed under vs2010 at ordinary times, it is noticed during deployment that the GCC version 4.4 in centos6 does not support lambda. It must be supported at least in version 4.5.
All right, since 4.7 is coming, compile it.
After a Google attack, many of my colleagues wrote complex statements and made them more complex. I had a lot of detours and hoped to provide some help to others!
FirstCodeGet it out
Install the following package. Otherwise, you may fail to get the libc. A error.
Sudo Yum install glibc-static libstdc ++-static
Wget http://ftp.gnu.org/gnu/gcc/gcc-4.7.0/gcc-4.7.0.tar.gz
Tar xvf gcc-4.7.0.tar.gz
CD gcc-4.7.0
./Contrib/download_prerequisites
CD ..
Mkdir build_gcc4.7
CD build_gcc4.7
../Gcc-4.7.0/configure -- enable-checking = release -- enable-packages ages = C, C ++ -- disable-multilib
Make-J4
Sudo make install
I spent more than an hour on the server .. Slow down the machine ..
ManyArticleThey all said they were downloading the source code of the three libraries, such as the archive file, and compiling the source code by themselves, which was quite irrational and wasted a lot of time, because we may encounter version problems and Path Problems When downloading, installing, and installing on our own, a good solution is still
When using./contrib/download_prerequisites, it will automatically download and compile automatically.