Skip to content

Pluma on Visual Studio

This tutorial covers how to dynamically link Pluma in your projects. You can still statically link it, but I recommend the dynamic way.

Pluma is maintained using VC++ 2010 Express, but the explained configuration is also valid for other Visual Studio editions.

Setup a host application

  • Create a project
    Create a new “Win32 Console application“, preferably check the Empty project checkbox.
  • Configure the project properties
    • VC++ Directories
      Open the project properties. On the VC++ directories section, edit the include and library directories, adding the Pluma include and lib directories respectively. Screenshot of the dialog box for setting up the include directoriesScreenshot of the dialog box for setting up the library directories

    • Link against Pluma library
      On the Linker section, select Input and add pluma.lib on the additional dependencies. Note: if you want to use the Pluma debug version for your debug configuration, use the ā€œ-dā€ sufix: pluma-d.lib. Screenshot of the dialog box for including pluma.lib as additional dependency.
  • Build
    All configured, create a dummy code that uses Pluma and build it, just to see if everything goes fine. Here’s a dummy code which does nothing:

    #include <Pluma/Pluma.hpp>
    
    int main(){
        pluma::Pluma pluma;
        return 0;
    }

    If you got errors, make sure that the project properties are correct for the target that you’re trying to build.

  • Execute
    The binary files (executable) of your host application won’t run without pluma.dll. Copy pluma.dll from your Pluma installation into the folder where your executable is generated (usually a bin folder on your project).

Setup a plug-in application

  • Create a project
    Create a new “Win32 Application“, setup it to be an empty DLL project.
    Screenshot of the dialog box for creating a new empty DLL application
  • Configure project properties
    Open the project properties and do exactly as you did for the host application (VC++ Directories and Linker settings). Now for our plugin to be generated we need the preprocessor PLUGIN_EXPORTS. Go to the C/C++ section, select the Preprocessor subsection and on the Preprocessor Definitions add the PLUGIN_EXPORTS directive. Note: VC++ may have generated a MYPLUGIN_EXPORTS directive. In that case, just remove the MY prefix.
    Screenshot of the dialog box for setting the PLUGIN_EXPORTS preprocessor directive
  • Build
    All configured, create a new cpp file with a dummy code like this:

    #include <Pluma/Connector.hpp>
    
    PLUMA_CONNECTOR
    bool connect(pluma::Host& host){
        return true;
    }

    It should now build without errors, generating a dll file which can later be loaded by a host application.


Tutorial Index