我已经用visual studio创建了两个解决方案。我将第一个编译为静态库。我想在第二个解决方案中使用这个库,它是maya的一个插件。
对于第二个解决方案,我从Autodesk提供的hello world模板文件开始,除了将路径添加到我的库中并将其包括在内之外,没有做任何更改。我一直收到这样的错误:
Severity Code Description Project File Line Suppression State
Error LNK1120 2 unresolved externals ddRbf C:\Users\daniele\Documents\workspace\ddPlugins\ddRbf\x64\Release\ddRbf.mll 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "public: void __cdecl ddMatrix::print(void)const " (?print@ddMatrix@@QEBAXXZ) referenced in function "public: virtual class Autodesk::Maya::OpenMaya20180000::MStatus __cdecl ddRbf::compute(class Autodesk::Maya::OpenMaya20180000::MPlug const &,class Autodesk::Maya::OpenMaya20180000::MDataBlock &)" (?compute@ddRbf@@UEAA?AVMStatus@OpenMaya20180000@Maya@Autodesk@@AEBVMPlug@345@AEAVMDataBlock@345@@Z) ddRbf C:\Users\daniele\Documents\workspace\ddPlugins\ddRbf\ddRbf.obj 1
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "public: __cdecl ddMatrix::ddMatrix(class std::vector<class std::vector<double,class std::allocator<double> >,class std::allocator<class std::vector<double,class std::allocator<double> > > >)" (??0ddMatrix@@QEAA@V?$vector@V?$vector@NV?$allocator@N@std@@@std@@V?$allocator@V?$vector@NV?$allocator@N@std@@@std@@@2@@std@@@Z) referenced in function "public: virtual class Autodesk::Maya::OpenMaya20180000::MStatus __cdecl ddRbf::compute(class Autodesk::Maya::OpenMaya20180000::MPlug const &,class Autodesk::Maya::OpenMaya20180000::MDataBlock &)" (?compute@ddRbf@@UEAA?AVMStatus@OpenMaya20180000@Maya@Autodesk@@AEBVMPlug@345@AEAVMDataBlock@345@@Z) ddRbf C:\Users\daniele\Documents\workspace\ddPlugins\ddRbf\ddRbf.obj 1
经过大量的研究和测试,我发现如果我将项目属性>常规>项目默认值>配置从动态链接库更改为静态,它就会编译,尽管在这一点上,当我试图在maya中加载编译的.mll文件时,我得到了这个错误:
// Error: file: C:/Program Files/Autodesk/Maya2018/scripts/others/pluginWin.mel line 290: Unable to dynamically load : C:/Users/daniele/Documents/maya/plug-ins/ddRbf.mll
// Error: file: C:/Program Files/Autodesk/Maya2018/scripts/others/pluginWin.mel line 290: (ddRbf) //
因此,我猜解决方案是将第一个.sln文件编译为动态链接库,但我想知道是否有一种方法可以只使用静态库而不必执行该步骤。
谢谢!
发布于 2019-05-15 23:14:12
我发现了问题,我把库编译成了x86,把插件编译成了x64。我将两者都编译为x64 now和works。
https://stackoverflow.com/questions/56112378
复制相似问题