【问题标题】:Problems in building Xerces library as a universal binary on Mac在 Mac 上将 Xerces 库构建为通用二进制文件的问题
【发布时间】:2021-10-30 12:56:21
【问题描述】:

我正在尝试使用 XCode 12.3 编译 xerces 3.1.1 和 3.2.3,以便为 Intel 和 M1 制作通用库。

我正在运行以下配置步骤:

./configure CFLAGS="-arch x86_64 -arch arm64" CXXFLAGS="-arch x86_64 -arch arm64"

我得到以下输出:

checking build system type... x86_64-apple-darwin19.6.0
checking host system type... x86_64-apple-darwin19.6.0
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether UID '502' is supported by ustar format... yes
checking whether GID '20' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether to use rpath... yes
checking for g++... g++
checking whether the C++ compiler works... no
configure: error: in `/Users/prj/3rd Party/Apache/xerces-c-src_3_2_3':
configure: error: C++ compiler cannot create executables
See `config.log' for more details

因此我想知道是否可以为英特尔和 M1 芯片构建 Xerces 3.1.1 或 3.2.3,即本质上作为 Mac 中的通用二进制文件。

谢谢,

【问题讨论】:

    标签: macos apple-m1 xerces xcode12.3


    【解决方案1】:

    我建议您使用 CMake 构建 Xerces 而不是配置脚本,并在您的 cmake 命令中添加以下变量:

    CMAKE_OSX_ARCHITECTURES=arm64;x86_64

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-06-19
      • 2018-07-22
      • 2023-03-04
      • 2011-03-19
      • 2011-03-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多