我用FreeBSD内核在服务器上安装了amd64 12.2。我试图编译我的源代码,它是为i386系统创建的。我得到了一个错误:
在搜索/usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd12.3/9.5.0/../../../libstdc++.a时跳过不兼容的-lstdc++
我想这是因为我需要共享的i386库库,我正在寻找如何安装它们。只是找到了通过"bsdinstall“安装它,而bsdinstall在我的根目录上不工作,或者解压一个不在我的系统中的.tgz文件。
发布于 2022-11-14 14:35:07
1.您必须检查您的包(lang/gcc9)是否使用使用pkg info gcc9的选项multilib=ON编译,并参见Options部分。如果没有,则必须从端口树/usr/ports/lang/gcc9执行此操作:
$ sudo make config
(set 'Multilib' option to ON)
$ sudo make
$ sudo make install clean或作为根(一击,如你所愿.):
# make config install cleanFYI,FreeBSD默认支持32位,请参阅/usr/lib32,并不要忘记在构建项目时检查是否包含此目录。
一些信息:
请在继续之前检查/阅读这些文档。
2.如果您已经安装/编译了gcc9,并将multilib选项设置为ON,那么您的环境(IDE、编译器选项中的路径丢失等)会带来麻烦。
编辑:在检查我自己的编译器时,我忘记提到gcc/g++可以报告它是否是用multilib支持编译的,使用preproc内置信息(参见下面的--enable-multilib ),您可以使用以下示例:
$ g++ -m32 -E -P -v -dD
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-portbld-freebsd13.0
Configured with: /wrkdirs/usr/ports/lang/gcc11/work/gcc-11.3.0/configure --enable-multilib --with-build-config=bootstrap-lto-noplugin --disable-nls --enable-gnu-indirect-function --enable-host-shared --enable-plugin --libdir=/usr/local/lib/gcc11 --libexecdir=/usr/local/libexec/gcc11 --program-suffix=11 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc11/include/c++/ --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --without-zstd --enable-languages=c,c++,objc,fortran,jit --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/man --infodir=/usr/local/share/info/gcc11 --build=x86_64-portbld-freebsd13.0
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.3.0 (FreeBSD Ports Collection)https://stackoverflow.com/questions/74430816
复制相似问题