首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在配置类型设置为动态链接库的解决方案中使用静态库?

如何在配置类型设置为动态链接库的解决方案中使用静态库?
EN

Stack Overflow用户
提问于 2019-05-13 20:28:47
回答 1查看 104关注 0票数 0

我已经用visual studio创建了两个解决方案。我将第一个编译为静态库。我想在第二个解决方案中使用这个库,它是maya的一个插件。

对于第二个解决方案,我从Autodesk提供的hello world模板文件开始,除了将路径添加到我的库中并将其包括在内之外,没有做任何更改。我一直收到这样的错误:

代码语言:javascript
运行
复制
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文件时,我得到了这个错误:

代码语言:javascript
运行
复制
// 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文件编译为动态链接库,但我想知道是否有一种方法可以只使用静态库而不必执行该步骤。

谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-05-15 23:14:12

我发现了问题,我把库编译成了x86,把插件编译成了x64。我将两者都编译为x64 now和works。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56112378

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档