Issues building NeoHookean plugin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • JonahA
    Member
    • Jun 2018
    • 38

    Issues building NeoHookean plugin

    Hi,

    Before building my own plugin, I've been trying to build the sample NeoHookean plugin, to make sure everything works properly. I downloaded Visual Studio 2015, and followed the instructions for creating a plugin in VS, added the include files as specified, and put the source files from the downloaded plugin in the same folder as the project and added them under "source files." I also disabled precompiled headers, since it was giving lots of errors and it didn't seem strictly necessary . However, it still won't build. It's giving errors related to "unresolved externals," despite the inclusion of the lib and bin directories from the Febio SDK.



    What could be the problem here?
  • maas
    Lead Code Developer
    • Nov 2007
    • 3400

    #2
    FEBio 2.x is built with Visual Studio 2013, not VS 2015. You need to have the same version of VS in order to build plugins. I can built the SDK with VS 2015, but this may take a few days to get that done. Alternatively, you can try to install VS 2013. Let me know what you want to do. (FYI, future versions of FEBio will be built with VS 2015 and VS 2017).

    Cheers,

    Steve
    Department of Bioengineering, University of Utah
    Scientific Computing and Imaging institute, University of Utah

    Comment

    • JonahA
      Member
      • Jun 2018
      • 38

      #3
      I don't think that's the cause of the issues. I am getting similar errors (unresolved externals) in VS 2013.

      Comment

      • JonahA
        Member
        • Jun 2018
        • 38

        #4
        Originally posted by maas View Post
        FEBio 2.x is built with Visual Studio 2013, not VS 2015. You need to have the same version of VS in order to build plugins. I can built the SDK with VS 2015, but this may take a few days to get that done. Alternatively, you can try to install VS 2013. Let me know what you want to do. (FYI, future versions of FEBio will be built with VS 2015 and VS 2017).

        Cheers,

        Steve
        By moving the SDK to a directory without spaces, choosing x64 and Release settings, and adding fecore.lib and febiomech.lib to the additional dependencies, I was able to reduce the externals errors down to one. "Error 1 error LNK2001: unresolved external symbol "public: void __cdecl FECoreKernel::RegisterClassW(class FECoreFactory *)" (?RegisterClassW@FECoreKernel@@QEAAXPEAVFECoreFact ory@@@Z)."

        Comment

        • maas
          Lead Code Developer
          • Nov 2007
          • 3400

          #5
          Not sure about that one. One possibility is that you are including windows.h somewhere. This file defines a RegisterClass macro which might be interfering with the FECoreKernel member function. If that's the cause you should be able to remove this header file.

          Steve
          Department of Bioengineering, University of Utah
          Scientific Computing and Imaging institute, University of Utah

          Comment

          • JonahA
            Member
            • Jun 2018
            • 38

            #6
            Removing the import stdax.h line worked. It was interference with the RegisterClass macro, as you said. Removing that made it build, albeit with warnings vs120pdb not found. I was also able to build my own plugin, and FeBio ran properly after the files were included. However, the plugins aren't showing up in PreView. Is there any way to add them to PreView so that they can be selected there like any pre-included material?

            Comment

            • maas
              Lead Code Developer
              • Nov 2007
              • 3400

              #7
              Glad to hear you got it working. You can ignore that warning about the pdb file not found, however, double-check that your debug version is linking to the debug versions of FEBio and VS12 and that the release version of your plugin links to the corresponding release versions of FEBio and VS.

              PreView knows nothing about FEBio plugins, so that's why they won't show up (In the future, PreView and FEBio will be integrated more closely and this will be possible, but that may still be a few versions out.) I'm afraid the only work-around is to assign a dummy material (assuming you are building a material plugin) and then manually modify the feb file (or write a small script that will do it for you).

              Cheers,

              Steve
              Department of Bioengineering, University of Utah
              Scientific Computing and Imaging institute, University of Utah

              Comment

              Working...
              X
              😀
              😂
              🥰
              😘
              🤢
              😎
              😞
              😡
              👍
              👎