【问题标题】:Setting up eigen math library with visual studio使用 Visual Studio 设置 eigen 数学库
【发布时间】:2021-11-22 07:10:10
【问题描述】:

我已经下载了 eigen 并尝试使用 Visual Studio 进行设置。我当前的文件结构如下所示:

project:

src
Vendor

src:

main.cpp

Vendor:

Eigen

这是我的 main.cpp 文件。

#include "../Vendor/Eigen/Core/Matrix.h"
#include <iostream>

int main()
{
    Vector3f v;
}

我收到了数百个错误。 第一个错误是文件atomic中的identifier uintptr_t is undefined

编辑:我打开了文件"../Vendor/Eigen/Core/Matrix.h",它似乎包含错误(有些行带有波浪形的红色下划线)。

【问题讨论】:

  • 有什么错误?
  • 哪个 Visual Studio 版本?
  • 您的 Eigen 版本是从哪里获得的?目录结构好像不对
  • @RoQuOTriX 我从这里得到它eigen.tuxfamily.org/index.php?title=Main_Page
  • 检查第一个错误。 Matrix.h 找到了吗?

标签: c++ eigen


【解决方案1】:

这只是一个猜测,取决于您的源结构,但您复制了错误的源:

您需要将Eigen 目录复制到您的Vendor 而不是Eigen 目录中的src。然后尝试:

#include <Eigen/Core>

本征结构

Eigen
|--> .gitlab
|--> Eigen / you need to copy this full directory
     |--> src      / I guess you copied this
     |--> Cholesky
     |--> ...
     ...
|--> bench
|--> ...
...

【讨论】:

    猜你喜欢
    • 2013-05-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-01
    • 2019-01-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多