【发布时间】:2020-01-04 08:52:28
【问题描述】:
我正在尝试在 Windows 上将 OpenBLAS 库与 MinGW w64 编译器链接。
这是我的代码:
#include <cstdio>
#include <cblas.h>
#include <cstdlib>
int main(){
double m[10],n[10];
int i, result;
for(i=0;i<10;i++)
m[i] = 1.0l*rand()/RAND_MAX;
for(i=0;i<10;i++)
n[i] = 1.0l*rand()/RAND_MAX;
result = cblas_ddot(10, m, 1, n, 1);
return 0;
}
并使用此命令进行编译:
g++ ^ -IC:\OpenBLAS-0.3.6-x64\include -LC:\OpenBLAS-0.3.6-x64\lib -lopenblas blas.cpp
得到一个错误
undefined reference to `cblas_ddot'
我从 here 下载了预编译的二进制文件,并使用 64 位 Windows,g++ (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0
我该如何解决这个错误?
【问题讨论】:
标签: windows mingw undefined-reference blas openblas