You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac M1芯片环境下VSCode与g++无法找到QuantLib头文件求助

Mac M1芯片下QuantLib头文件无法定位问题

问题情况

已在Mac M1芯片上成功安装QuantLib,但VSCode与g++均无法定位QuantLib头文件,怀疑与硅芯片架构相关。

已尝试的解决操作

  • 在c_cpp_properties.json中添加include路径:
    /opt/homebrew/Cellar/quantlib/1.28/include、/opt/homebrew/Cellar/boost/1.80.0/include
  • 在.zshrc文件中添加环境变量:
export CPLUS_INCLUDE_PATH=/opt/homebrew/include
export C_INCLUDE_PATH=/opt/homebrew/include
export CPATH=/opt/homebrew/include
export LIBRARY_PATH=/opt/homebrew/lib

当前报错信息

test.cpp:3:10: fatal error: 'ql/quantlib.hpp' file not found

现有c_cpp_properties.json配置

{
"configurations": [
    {
        "name": "Mac",
        "includePath": [
            "${workspaceFolder}",
            "/opt/homebrew/Cellar/quantlib/1.28/include",
            "/opt/homebrew/Cellar/boost/1.80.0/include"
        ],
        "defines": [],
        "macFrameworkPath": [
            "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
        ],
        "compilerPath": "/usr/bin/clang",
        "cStandard": "c17",
        "cppStandard": "c++17",
        "intelliSenseMode": "macos-clang-arm64"
    }
],
"version": 4
}

内容的提问来源于stack exchange,提问作者ceejam

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.11 22:50:29