在构建项目后将库连接到QT时出现以下错误:
util.obj:-1: error: LNK2019: unresolved external symbol umfpack_di_symbolic referenced in function "public: void __cdecl util::Get_Initial_Solution(double *,class Mesh &)" (?Get_Initial_Solution@util@@QEAAXPEANAEAVMesh@@@Z)
我尝试重建项目,并确保我使用的库和编译器的版本兼容MSVC 2015 64位。我使用QT创建者中的内置管理器从VCPKG“UMFPACK”引用库,如下所示:
QMAKE_LIBDIR += "C:/vcpkg-master/installed/x64-windows/lib"
win32:CONFIG(release, debug|release): LIBS += -L"C:/vcpkg-master/installed/x64-windows/lib/" -llibumfpack
INCLUDEPATH += "C:/vcpkg-master/installed/x64-windows/include/suitesparse"
DEPENDPATH += "C:/vcpkg-master/installed/x64-windows/include/suitesparse"
这是抛出错误的get_initial_solution函数(一些部分从三个点替换的代码中删除。只是为了简单起见。
void util::Get_Initial_Solution(double *Sol, Mesh &EHL)
{
.
.
.
umfpack_di_symbolic(2*EHL.N_Nodes_2D,2*EHL.N_Nodes_2D,
Kee_colptr,Kee_rowind,Kee_nzval,&Symbolic, null,null);
umfpack_di_numeric(Kee_colptr,Kee_rowind,Kee_nzval,Symbolic,&Numeric,null,null);
umfpack_di_free_symbolic(&Symbolic);
umfpack_di_solve(UMFPACK_A, Kee_colptr,Kee_rowind, Kee_nzval, x, rhs_hertz, Numeric, null, null);
umfpack_di_free_numeric(&Numeric);
.
.
.
}
知道导致此错误的原因是什么?提前谢谢