C++ - g++-11: 错误: 无法识别的命令行选项 '-Xarch_arm64'

发布于 2025-01-10 16:41:45 字数 6047 浏览 0 评论 0原文

我正在尝试在我的 M1 Mac 上构建应用程序,这是我的 cmake 配置的输出:

"/Applications/CLion 2022.1 EAP.app/Contents/bin/cmake/mac/bin/cmake" -DCMAKE_BUILD_TYPE=Debug "-DCMAKE_MAKE_PROGRAM=/Applications/CLion 2022.1 EAP.app/Contents/bin/ninja/mac/ninja" -DCMAKE_C_COMPILER=/opt/homebrew/bin/gcc-11 -DCMAKE_CXX_COMPILER=/opt/homebrew/bin/g++-11 -DOPENSSL_ROOT_DIR=/opt/homebrew/Cellar/[email protected]/1.1.1m -DOPENSSL_LIBRARIES=/opt/homebrew/Cellar/[email protected]/1.1.1m/lib -G Ninja -S /Users/venelin/TrinityCore -B /Users/venelin/TrinityCore/cmake-build-debug
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/homebrew/bin/gcc-11 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/homebrew/bin/g++-11 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detected 64-bit platform
-- UNIX: Using default configuration directory
-- UNIX: Configuring uninstall target
-- UNIX: Created uninstall target
-- UNIX: Using default system linker
-- UNIX: Detected compiler: /opt/homebrew/bin/gcc-11
-- GCC: Minimum version required is 8.3.0, found 11.2.0 - ok!
-- GCC: SFMT enabled, SSE2 flags forced
-- Using mysql-config: /usr/local/mysql/bin/mysql_config
-- Found MySQL library: /usr/local/mysql/lib/libmysqlclient.dylib
-- Found MySQL headers: /usr/local/mysql/include
-- Found MySQL executable: /usr/local/mysql/bin/mysql
-- Found Git: /usr/local/bin/git (found suitable version "2.33.0", minimum required is "1.7") 

* TrinityCore revision   : f6409efcf664+ 2022-02-28 17:00:20 +0100 (master branch)
* TrinityCore buildtype  : Debug

* Install core to        : /usr/local
* Install configs to     : /usr/local/etc

* Build world/auth       : Yes (default)
* Build with scripts     : Yes (static)
* Build map/vmap tools   : Yes (default)
* Build unit tests       : No (default)
* Build core w/PCH       : Yes (default)
* Build scripts w/PCH    : Yes (default)
* Show compile-warnings  : No  (default)
* Use coreside debug     : No  (default)
* Show source tree       : Yes (hierarchical)
* Use GIT revision hash  : Yes (default)

-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found Boost: /opt/homebrew/lib/cmake/Boost-1.76.0/BoostConfig.cmake (found suitable version "1.76.0", minimum required is "1.71") found components: system filesystem program_options iostreams regex 
-- Performing Test boost_filesystem_copy_links_without_NO_SCOPED_ENUM
-- Performing Test boost_filesystem_copy_links_without_NO_SCOPED_ENUM - Success
-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib/libz.tbd (found version "1.2.11") 
-- Looking for strtod_l
-- Looking for strtod_l - found
-- Performing Test HAVE_NEON
-- Performing Test HAVE_NEON - Failed
CMake Warning at dep/SFMT/CMakeLists.txt:58 (message):
  Neon not available - performance will be poor!


-- Found OpenSSL: /opt/homebrew/Cellar/[email protected]/1.1.1m/lib/libcrypto.dylib (found version "1.1.1m") found components: Crypto SSL 
-- Found OpenSSL library: /opt/homebrew/Cellar/[email protected]/1.1.1m/lib/libssl.dylib;/opt/homebrew/Cellar/[email protected]/1.1.1m/lib/libcrypto.dylib
-- Found OpenSSL headers: /opt/homebrew/Cellar/[email protected]/1.1.1m/include
-- Found Readline: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib/libreadline.tbd  
-- Found Readline library: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib/libreadline.tbd
-- Found Readline headers: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include

* Script configuration (static):
    |
    +- worldserver
    |   +- Argus
    |   +- Battlefield
    |   +- BrokenIsles
    |   +- Commands
    |   +- Custom
    |   +- EasternKingdoms
    |   +- Events
    |   +- Kalimdor
    |   +- Maelstrom
    |   +- Northrend
    |   +- OutdoorPvP
    |   +- Outland
    |   +- Pet
    |   +- Spells
    |   +- World
    |

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/venelin/TrinityCore/cmake-build-debug

Problems were encountered while collecting compiler information:
    g++-11: error: unrecognized command-line option '-Xarch_arm64'

[Finished]

你知道为什么我会收到此错误:

Problems were encountered while collecting compiler information:
    g++-11: error: unrecognized command-line option '-Xarch_arm64'

我该如何修复它?

I am trying to build app on my M1 Mac and here is the output of my cmake config:

"/Applications/CLion 2022.1 EAP.app/Contents/bin/cmake/mac/bin/cmake" -DCMAKE_BUILD_TYPE=Debug "-DCMAKE_MAKE_PROGRAM=/Applications/CLion 2022.1 EAP.app/Contents/bin/ninja/mac/ninja" -DCMAKE_C_COMPILER=/opt/homebrew/bin/gcc-11 -DCMAKE_CXX_COMPILER=/opt/homebrew/bin/g++-11 -DOPENSSL_ROOT_DIR=/opt/homebrew/Cellar/[email protected]/1.1.1m -DOPENSSL_LIBRARIES=/opt/homebrew/Cellar/[email protected]/1.1.1m/lib -G Ninja -S /Users/venelin/TrinityCore -B /Users/venelin/TrinityCore/cmake-build-debug
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/homebrew/bin/gcc-11 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/homebrew/bin/g++-11 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detected 64-bit platform
-- UNIX: Using default configuration directory
-- UNIX: Configuring uninstall target
-- UNIX: Created uninstall target
-- UNIX: Using default system linker
-- UNIX: Detected compiler: /opt/homebrew/bin/gcc-11
-- GCC: Minimum version required is 8.3.0, found 11.2.0 - ok!
-- GCC: SFMT enabled, SSE2 flags forced
-- Using mysql-config: /usr/local/mysql/bin/mysql_config
-- Found MySQL library: /usr/local/mysql/lib/libmysqlclient.dylib
-- Found MySQL headers: /usr/local/mysql/include
-- Found MySQL executable: /usr/local/mysql/bin/mysql
-- Found Git: /usr/local/bin/git (found suitable version "2.33.0", minimum required is "1.7") 

* TrinityCore revision   : f6409efcf664+ 2022-02-28 17:00:20 +0100 (master branch)
* TrinityCore buildtype  : Debug

* Install core to        : /usr/local
* Install configs to     : /usr/local/etc

* Build world/auth       : Yes (default)
* Build with scripts     : Yes (static)
* Build map/vmap tools   : Yes (default)
* Build unit tests       : No (default)
* Build core w/PCH       : Yes (default)
* Build scripts w/PCH    : Yes (default)
* Show compile-warnings  : No  (default)
* Use coreside debug     : No  (default)
* Show source tree       : Yes (hierarchical)
* Use GIT revision hash  : Yes (default)

-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found Boost: /opt/homebrew/lib/cmake/Boost-1.76.0/BoostConfig.cmake (found suitable version "1.76.0", minimum required is "1.71") found components: system filesystem program_options iostreams regex 
-- Performing Test boost_filesystem_copy_links_without_NO_SCOPED_ENUM
-- Performing Test boost_filesystem_copy_links_without_NO_SCOPED_ENUM - Success
-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib/libz.tbd (found version "1.2.11") 
-- Looking for strtod_l
-- Looking for strtod_l - found
-- Performing Test HAVE_NEON
-- Performing Test HAVE_NEON - Failed
CMake Warning at dep/SFMT/CMakeLists.txt:58 (message):
  Neon not available - performance will be poor!


-- Found OpenSSL: /opt/homebrew/Cellar/[email protected]/1.1.1m/lib/libcrypto.dylib (found version "1.1.1m") found components: Crypto SSL 
-- Found OpenSSL library: /opt/homebrew/Cellar/[email protected]/1.1.1m/lib/libssl.dylib;/opt/homebrew/Cellar/[email protected]/1.1.1m/lib/libcrypto.dylib
-- Found OpenSSL headers: /opt/homebrew/Cellar/[email protected]/1.1.1m/include
-- Found Readline: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib/libreadline.tbd  
-- Found Readline library: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib/libreadline.tbd
-- Found Readline headers: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include

* Script configuration (static):
    |
    +- worldserver
    |   +- Argus
    |   +- Battlefield
    |   +- BrokenIsles
    |   +- Commands
    |   +- Custom
    |   +- EasternKingdoms
    |   +- Events
    |   +- Kalimdor
    |   +- Maelstrom
    |   +- Northrend
    |   +- OutdoorPvP
    |   +- Outland
    |   +- Pet
    |   +- Spells
    |   +- World
    |

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/venelin/TrinityCore/cmake-build-debug

Problems were encountered while collecting compiler information:
    g++-11: error: unrecognized command-line option '-Xarch_arm64'

[Finished]

Do you have any idea why I get this error:

Problems were encountered while collecting compiler information:
    g++-11: error: unrecognized command-line option '-Xarch_arm64'

And how can I fix it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文