Announcement

Collapse
No announcement yet.

Problems with the Plugin SDK...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems with the Plugin SDK...

    I'm running VS2010 with version 2 of the SDK, and I've got a plugin with stub methods that actually do nothing building and actually working in an installer. That said, no sooner do I start trying to use any of the IRLUA_PLUGIN_* helper functions than I start getting LNK2005 for operator new and operator delete in nafxcw*; already defined in libcmtd.lib. This is apparently an issue with these functions needing MFC, of all things, and it's apparently linked in the wrong order; the C runtime should have been linked first.

    Unfortunately, the solutions offered here: http://support.microsoft.com/kb/148652/en-us either do not work or do not apply to this version of VStudio, being for VC 2005. Does anyone have a simple solution to this so I can quit chasing my tail? I'd hate to not be able to use some of these IRLUA_PLUGIN_* functions, since a few of them are actually specific to SUF, and I think I'll need them.

    One more thing, just for my personal edification? Why on EARTH would the author of this SDK stick the rest of us with the need to suck in MFC??
    Thanks,
    DDoutelMS

  • #2
    Can you build the sample projects which are provided in the SDK, such as the Clipboard plugin? A solution file is provided in the SDK, which should link properly. Once you have this, you can compare the projects and see what you got wrong in yours...

    Ulrich

    Comment


    • #3
      Yeah, I've done that comparison, several times, Ulrich; clipboard builds without issue, mine doesn't, and the settings are all pretty much the same. Just thought I'd see if there was something I was missing.

      Thanks for the reply, Ulrich!
      Duane

      Comment


      • #4
        You could use something like CopyWiz to copy an existing solution to a new location, changing the name. Afterwards, customize the new project by adding your own custom code and build the new plugin. This is how I start a new project - I create a new solution based on an existing (and tested) work, and replace the functions. It saves time and avoids mistakes.

        Ulrich

        Comment


        • #5
          yup! That's basically what I did, started with Clipboard, and have been embellishing. Created a virtual base class as a starting point for action plugins. Works great, too, as long as I stick to straight Lua calls...

          Comment


          • #6
            Thought I'd post back here for anyone running into this in future.

            In VS2010:

            In the Linker/Input property page for the project, add libcmt.lib;nafxcw.lib; to the Ignore Specific Default Libraries field. Then, in the Additional Dependencies field, make sure to place nafxcw.lib;libcmt.lib;; the order of these two libraries matters. It's what causes the linker error in the first place.

            Comment

            Working...
            X
            😀
            🥰
            🤢
            😎
            😡
            👍
            👎