gpt4 book ai didi

c++ - 为 freebsd 11 : error: unknown type name 'choke' 编译 gcc4.8.5 时出错

转载 作者:太空宇宙 更新时间:2023-11-04 11:54:25 25 4
gpt4 key购买 nike

在新的 Ubuntu 14.04 机器上重现错误的步骤。

  1. 从以前安装的 freebsd 机器的/usr 获取 include 和 lib 文件夹。
  2. 在ubuntu机器的主目录中设置文件夹。

现在,要运行的命令

sudo apt-get update
sudo apt-get install gcc g++ freebsd-buildutils gobjc++-mingw-w64-x86-64 gobjc++-mingw-w64-i686 gobjc++ flex bison libisl-dev libelf-dev binutils-dev libc6-dev linux-libc-dev build-essential
sudo apt-get install zip unzip
sudo apt-get install cloog-isl libcloog-isl-dev ppl-dev libspice-client-glib-2.0-dev
sudo apt-get install gawk mawk patch
sudo mkdir /opt/cross-freebsd && sudo chown -R $USER /opt/cross-freebsd
sudo mkdir build-tmp && cd build-tmp
pushd .
cd ~
cp -a include/. /opt/cross-freebsd/x86_64-pc-freebsd10/
cp -a lib/. /opt/cross-freebsd/x86_64-pc-freebsd10/lib/
ls /opt/cross-freebsd/x86_64-pc-freebsd10/
popd
pushd .
cd /opt/cross-freebsd/x86_64-pc-freebsd10/lib
ln -s libm.so.5 libm.so
ln -s libc.so.7 libc.so
popd
wget http://ftp.gnu.org/gnu/binutils/binutils-2.25.1.tar.gz
tar xf binutils-2.25.1.tar.gz
cd binutils-2.25.1/
./configure --enable-libssp --enable-gold --enable-ld \
--target=x86_64-pc-freebsd10 --prefix=/opt/cross-freebsd
fmake -j4
fmake install
cat config.log | grep -in error

预期:没有错误

结果:

77:Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.4' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
82:gcc: error: unrecognized command line option '-V'
83:gcc: fatal error: no input files
87:gcc: error: unrecognized command line option '-qversion'
88:gcc: fatal error: no input files
137:Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.4' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
142:g++: error: unrecognized command line option '-V'
143:g++: fatal error: no input files
147:g++: error: unrecognized command line option '-qversion'
148:g++: fatal error: no input files
238:conftest.c:15:5: error: unknown type name 'choke'
740:stage2_werror_flag=''

我该怎么做才能避免这些错误?

最佳答案

What can I do to avoid these errors?

你不能,这些错误不是有效的,而只是来自 configure 确定你所处配置的方式。

例如,为了检查 CLooG 的版本是否为 0.17.0,它编译了一个包含以下内容的文件:

#include "cloog/version.h"
int
main ()
{
#if CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 17 || CLOOG_VERSION_REVISION < 0
choke me
#endif
;
return 0;
}

编译时出错提示CLOOG_VERSION_MAJOR != 0 || CLOOG_VERSION_MINOR != 17 || CLOOG_VERSION_REVISION < 0是真的。在这种情况下,错误是由于 choke me 引起的但它可能来自任何其他无效形式。编译不报错说明版本是0.17.0,报错说明版本不是0.17.0,仅此而已。

等等

终于一切顺利

关于c++ - 为 freebsd 11 : error: unknown type name 'choke' 编译 gcc4.8.5 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54881738/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com