好的,所以,我从ubuntu 12.04 64位切换到32位并安装 build-essential.
然后我编译并安装了GMP-5.0.5,MPFR-3.1.1,MPC-1.0,ISL-0.10和CLOOG-0.17.0.我检查了主gcc trunk的副本,并尝试使用以下配置行(来自单独的目录)构建它:
../svnsrc/configure --prefix=/usr/GCC/svn --enable-__cxa_atexit --with-plugin-ld=/usr/bin/ld.gold --enable-threads=posix --enable-werror --enable-build-with-cxx --with-gmp=/usr/GCC/prereq/svn --with-mpfr=/usr/GCC/prereq/svn --with-mpc=/usr/GCC/prereq/svn --with-isl=/usr/GCC/prereq/svn --with-cloog=/usr/GCC/prereq/svn --enable-languages=c,c++
Run Code Online (Sandbox Code Playgroud)
配置运行正常,所以我跑了make && make check.这运行了一段时间,但随后失败,出现以下错误:
/home/matt/GCC/svnbuild/./gcc/xgcc -B/home/matt/GCC/svnbuild/./gcc/ -B/usr/GCC/svn/i686-pc-linux-gnu/bin/ -B/usr/GCC/svn/i686-pc-linux-gnu/lib/ -isystem /usr/GCC/svn/i686-pc-linux-gnu/include -isystem /usr/GCC/svn/i686-pc-linux-gnu/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -mlong-double-80 -I. -I. -I../.././gcc -I../../../svnsrc/libgcc -I../../../svnsrc/libgcc/. -I../../../svnsrc/libgcc/../gcc -I../../../svnsrc/libgcc/../include -I../../../svnsrc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../svnsrc/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS …Run Code Online (Sandbox Code Playgroud) 我正在编写一个函数作为Boost.Interprocess实验的一部分.在函数中,我将字符串文字分配给声明的变量constexpr char*.当我这样做时,我得到:
warning: deprecated conversion from string constant to char* [-Wwrite-strings].
我的理解constexpr是,在变量声明中,它的行为就像声明了变量一样const,但是添加了规则,必须初始化变量,并且初始化必须使用常量表达式.
有了这种理解,我希望constexpr char*表现为const char*,因此不发出警告.我错过了一些有关constexpr工作的方法吗?
我正在使用-std = c ++ 0x编译GCC 4.6.0 20110306.
发出警告的任何理由都将受到赞赏.谢谢!
我正在使用Boost.Filesystem来创建目录中的文件列表.我使用boost::filesystem::recursive_directory_iterator,并std::copy把每个路径到一个std ::向量作为一个boost::filesystem::directory_entry对象.我希望以std :: strings的形式输出到文件,所以我做了以下(\n以避免使用<<):
std::vector<boost::filesystem::directory_entry> buffer; //filled with paths
...
std::vector<std::string> buffer_native(buffer.size());
//transform directory_entry into std::string, and add a \n, so output is formatted without use of <<
std::transform(buffer.begin(),buffer.end(),buffer_native.begin(), [](boost::filesystem::directory_entry de)->std::string
{
std::string temp=de.path().string();
temp+="\n";
return temp;
}
buffer.clear();
std::copy(buffer_native.begin(),buffer_native.end(),std::ostream_iterator<std::string>(out_file));
Run Code Online (Sandbox Code Playgroud)
然而,这个问题是它创建了两个向量,其原始立即被清除,因为它不需要.这听起来像移动语义的完美位置,但是n3242只提供与C++ 98相同的两个转换重载.是否有可能实现移动语义std::transform?如果不是,那么编写自定义循环会更好吗?
我在Windows XP上使用GCC 4.5.2(MinGW).