处理一个TG代理GCC编译出错
每一次手机上TG都是开小火箭,很不方便,于是准备在vps(centos6.x)上搞个TG代理,于是几乎找到了https://github.com/TelegramMessenger/MTProxy这个东西.但是安装的时候出现了
cc1: error: unrecognized command line option “-std=gnu11”
嗯,原来是G++版本太旧了,无法使用g++ -std=c++11 命令来编译 C++11,所以得升级下g++.
cd /etc/yum.repos.d
wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo
yum --enablerepo=testing-1.1-devtools-6 install devtoolset-1.1-gcc devtoolset-1.1-gcc-c++
接下来替换到最新版本
ln -s /opt/centos/devtoolset-1.1/root/usr/bin/* /usr/local/bin/
hash -r
查看下版本,,,ok
➜ ~ g++ --version
g++ (GCC) 4.7.2 20121015 (Red Hat 4.7.2-5)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
然后在去安装https://github.com/TelegramMessenger/MTProxy就没有问题了…