在我的应用程序中,我有一个 dll,它公开了一个采用两个向量的函数:
static int myFunc( vector<double> vec1, vector<double> &vec2 );
当我将此声明更改为
static int myFunc( vector<double> &vec1, vector<double> &vec2 );
我收到一个链接器错误说:
error LNK2019: unresolved external symbol "__declspec(dllimport) public: static int __cdecl myFunctions::myFunc(class std::vector<double,class std::allocator<double> > &,class std::vector<double,class std::allocator<double> > &)" (__imp_?myFunc@myFunctions@@SAHAAV?$vector@NV?$allocator@N@std@@@std@@0@Z) referenced in function "public: void __thiscall MainWindow::modelMeanCurve(void)" (?modelMeanCurve@MainWindow@@QAEXXZ)
为什么会出现这种行为以及如何解决此错误,以便我也可以将引用传递给第一个参数?
谢谢,拉克什。