【问题标题】:CMake error "Can't link to the standard math library"CMake 错误“无法链接到标准数学库”
【发布时间】:2013-01-31 17:26:08
【问题描述】:

在尝试使用 CMake 配置我的 c++ 项目时,我遇到了以下错误消息:

C 编译器标识未知 CXX 编译器标识未知 Nestk/deps/eigen/CMakeLists.txt:71 处的 CMake 错误(消息): 无法链接到标准数学库。请向Eigen报告 开发人员,告诉他们你的平台。 配置不完整,出现错误!

有没有人提示如何解决这个问题?

非常感谢任何帮助。

我正在使用:Windows 7 x64、CMake 2.8.10.2、VS2010 Ultimate

【问题讨论】:

  • 您是否从 Visual Studio 命令提示符运行 cmake?
  • 你也选择了“Visual Studio 10 Win64”生成器吗?
  • 我既没有从 Visual Studio promt 运行 cmake(我正在使用 CMake-gui),也没有选择“Visual Studio 10 Win64”生成器(我将“Visual Studio 10”作为生成器) .

标签: visual-studio-2010 linker cmake


【解决方案1】:

这是因为

#include <cmath>

无法在您的机器上编译。你必须在你的路径上解决标准数学库错误(我在 ubuntu 中工作,但我必须安装 gcc 编译器)。尝试编译并运行这个程序:

#include<cmath>
#include<iostream>
int main() { std::cout << std::sin(0.0) << std::endl; std::cout << std::log(0.0f) << std::endl; }

一旦您可以这样做,请确保删除您运行 cmake 的构建目录并再次尝试构建。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-10
    • 2013-02-23
    • 1970-01-01
    • 2018-02-10
    • 1970-01-01
    相关资源
    最近更新 更多