question

萌 爱 avatar image
萌 爱 asked ·

#include "attributes/AttrHelper.h" lead to maya MNodeCLass dll missing

I wrote a maya shader node and want to make an extension for this node to make it renderable in Arnold, I use Visual Studio 2017 and Maya 2017 SP4, I have lib, include properly set, dll as output format, but once I include "NodeTranslator.h", my dll can't be compiled and shown error message below:

Arnold SDK version 5.0.2.0

error LNK2001: unresolved external symbol "__declspec(dllimport) public: class MNodeClass & __cdecl MNodeClass::operator=(class MNodeClass &&)" (__imp_??4MNodeClass@@QEAAAEAV0@$$QEAV0@@Z)
error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl MNodeClass::MNodeClass(class MNodeClass &&)" (__imp_??0MNodeClass@@QEAA@$$QEAV0@@Z)

Update : I found once a class defined by DLLEXPORT use a maya class like MNodeClass, this problem will occur, I thought during compiling, maya class tried to find a dynamic library, but it failed.

class DLLEXPORT CExtensionAttrHelper : public CBaseAttrHelper
{

public:
   /// @param mayaNodeClassName  name of maya class to add attributes to
   /// @param arnoldNodeEntry  arnold node entry to use when checking parameter metadata
   CExtensionAttrHelper(MString mayaNodeClassName, const AtNodeEntry* arnoldNodeEntry = NULL, const MString& prefix = "ai_", 
      bool addCommonAttributes = true) :
      CBaseAttrHelper(arnoldNodeEntry, prefix),
      m_class(mayaNodeClassName)
   {
      if (MTypeId(MFn::kInvalid) == m_class.typeId())
      {
         AiMsgWarning("[mtoa.attr] CExtensionAttrHelper was passed an unknown Maya node type \"%s\"",
                      mayaNodeClassName.asChar());
      }      
      if (addCommonAttributes)
         AddCommonAttributes();
   }
   /// @param mayaNodeClassName  name of maya class to add attributes to
   /// @param arnoldNodeEntryName  arnold node entry to use when checking parameter metadata
   CExtensionAttrHelper(MString mayaNodeClassName, const MString& arnoldNodeEntryName, const MString& prefix = "ai_", 
      bool addCommonAttributes = true) :
      CBaseAttrHelper(arnoldNodeEntryName, prefix),
      m_class(mayaNodeClassName)
   {
      if (MTypeId(MFn::kInvalid) == m_class.typeId())
      {
         AiMsgWarning("[mtoa.attr] CExtensionAttrHelper was passed an unknown Maya node type \"%s\"",
                      mayaNodeClassName.asChar());
      }
      /*
      FIXME : commenting out because of light portals which dump a warning here. Verify what has to be done !
      if (m_nodeEntry == NULL)
      {
         AiMsgWarning("[mtoa.attr] CExtensionAttrHelper was passed an unknown Arnold node type \"%s\" for Maya node type \"%s\"",
                      arnoldNodeEntryName.asChar(), mayaNodeClassName.asChar());
      }*/
      if (addCommonAttributes)
         AddCommonAttributes();
   }

   MString GetMayaNodeTypeName() const {return m_class.typeName();}

protected:   
   MStatus virtual addAttribute(MObject& attrib);

protected:
   void AddCommonAttributes();
   MNodeClass m_class;

};
mtoaarnold5
1 comment
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

#include "extension/Extension.h" Maybe this one cause the problem...

0 Likes 0 ·

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.