- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I am making a custom deformer using the MPxDeformerNode class. When I define the "deform" method inside of the class I am able to call weightValue(...) without issue, but when I declare the method inside the class and then define it outside the class calling weightValue causes a linker error. I tested this by removing everything but the weightValue query from the deform method so I know that this is the issue.
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: float __cdecl Autodesk::Maya::OpenMaya20180000::MPxDeformerNode::weightValue(class Autodesk::Maya::OpenMaya20180000::MDataBlock &,unsigned int,unsigned int)" (__imp_?weightValue@MPxDeformerNode@OpenMaya20180000@Maya@Autodesk@@QEAAMAEAVMDataBlock@234@II@Z) referenced in function "public: virtual class Autodesk::Maya::OpenMaya20180000::MStatus __cdecl offset::deform(class Autodesk::Maya::OpenMaya20180000::MDataBlock &,class Autodesk::Maya::OpenMaya20180000::MItGeometry &,class Autodesk::Maya::OpenMaya20180000::MMatrix const &,unsigned int)" (?deform@offset@@UEAA?
I've looked at some example deformers and they are able to call it in a function defined outside the class.
I was able to find a forum post that seemed to be related to this same issue but the response to that post was "use cmake".
Solved! Go to Solution.