c++ - LAPACK 函数 dgtsv 使用 c++/Visual Studio 提供未解析的外部符号

标签 c++ windows visual-studio-2017 lapack

我正在尝试在 Windows10/Visual Studio 2017 下编译代码,为此我必须使用 LAPACK 库的 dgtsv 函数。

我已将 Visual Studio 与我的 BLASLAPACK 库链接起来,并将 dll 复制到 system32。

我还安装了带有 g++ 和 fortran 编译器的 MinGW

extern "C" {
    void dgtsv(int*, int*, double*, double*, double*, double*, int*, int*);
}

但是编译器给我以下错误:

LNK2019 unresolved external symbol dgtsv referenced in function "private: void __cdecl"

感谢您给我的任何建议。

最佳答案

解决方案是在函数名后加下划线,即:

extern "C" {
    void dgtsv_(int*, int*, double*, double*, double*, double*, int*, int*);
}

关于c++ - LAPACK 函数 dgtsv 使用 c++/Visual Studio 提供未解析的外部符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44809966/

相关文章:

java - 在新的 Android 应用程序中使用大型引用项目

asp.net - Visual Studio 2017 Angular 6 显示 "Cannot Get/"仅限首次尝试

c++ - 流行软件中关于vcxproject路径的混淆

c++ - 从 linux 交叉编译到 windows 的 visual studio 项目

c++ - 不能在 cmake_pch.h 中包含标准库

c++ - 返回临时的右值作为值

c++ - 使用 qmake 和 MSVC2015 创建共享库(.lib 和 .dll)

Windows 脚本宿主错误 : Invalid character - Code:800A03F6 - Source: Microsoft JScript compilation error

c++ - 为什么 "if constexpr"不能用 Visual Studio 2017 15.3 编译?

C++在 namespace 中声明与全局 namespace 中的函数同名的函数