小音

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: macbook 使用vscode完成作业0的环境配置 #6809 Score: 0
    小音
    Participant

    对于brew install eigen的情况来说,
    可以使用brew link –overwrite eigen将eigen连接到/usr/local/include/eigen,
    此时在cmakelist.txt里加上一行include_directories(/usr/local/include)就可以解决找不到eigen3的问题。

    vscode在mac下的智能提示和报错问题,
    在.vscode文件夹下创建c_cpp_properties.json

    内容为
    {
    “configurations”: [
    {
    “name”: “Mac”,
    “includePath”: [
    “/usr/local/include”,
    “/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1”,
    “/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1”,
    “/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.3/include”,
    “/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include”,
    “${workspaceFolder}/**”,
    “${default}”
    ],
    “defines”: [],
    “macFrameworkPath”: [],
    “compilerPath”: “/usr/local/bin/gcc-10”,
    “cStandard”: “c11”,
    “cppStandard”: “gnu++14”,
    “intelliSenseMode”: “clang-x64”
    }
    ],
    “version”: 4
    }

    即可。
    不过如果更新gcc/clang/xcode版本,需要修改上述相关配置。

    in reply to: macbook 使用vscode完成作业0的环境配置 #6805 Score: 0
    小音
    Participant

    同样的问题。。。cmake没问题,但是make报错:

    /Users/hyperion/games101/pa0/main.cpp:2:9: fatal error: ‘eigen3/Eigen/Core’ file not found
    #include<eigen3/Eigen/Core>

    但是在vscode里是可以跳转到Eigen/Core的定义的。

    操作流程
    brew install eigen
    mkdir build
    cd build
    cmake ..
    make

    • This reply was modified 3 years, 9 months ago by 小音.
Viewing 2 posts - 1 through 2 (of 2 total)