annotate build/README.msvc @ 525:8c18bdaad04f c++11-mutex

Avoid simple static allocation of mutex, as it could lead to mutex being destroyed before last adapter that needs to use it (since adapters are usually also static)
author Chris Cannam
date Mon, 09 Sep 2019 10:24:13 +0100
parents 7a393db13c75
children
rev   line source
cannam@239 1
cannam@239 2 The Vamp Plugin SDK -- Platform Notes for Visual C++ on Windows
cannam@239 3 ===============================================================
cannam@239 4
Chris@489 5 This version of the SDK is contains project files for Visual C++ 2013
Chris@489 6 or newer. You can build the SDK in either 32-bit or 64-bit (x64) mode,
Chris@489 7 but remember that a 32-bit host generally cannot load 64-bit plugins.
cannam@239 8
cannam@239 9
Chris@489 10 Visual C++ Projects and Solution Files
Chris@489 11 --------------------------------------
Chris@489 12
Chris@489 13 Two Visual C++ solution files are included:
Chris@489 14
Chris@489 15 - build/VampSDK.sln
Chris@489 16
Chris@489 17 Builds the plugin SDK and the example plugins.
Chris@489 18 See the VampPluginSDK and VampExamplePlugins projects below.
Chris@489 19
Chris@489 20 - build/VampHostSDK.sln
Chris@489 21
Chris@489 22 Builds the host SDK and the simple-host command-line application.
Chris@489 23 See the VampHostSDK and VampSimpleHost projects below.
Chris@489 24 Note that the VampSimpleHost requires the libsndfile library; if
Chris@489 25 you want to build without that, use the VampHostSDK project rather
Chris@489 26 than this solution.
Chris@489 27
Chris@489 28 Four Visual C++ project files are included:
Chris@489 29
Chris@489 30 - build/VampPluginSDK.vcxproj
cannam@239 31
cannam@239 32 This builds the plugin SDK into a single static library, but does
cannam@239 33 not build the example plugins, the host SDK, or the host. (We
cannam@239 34 recommend using static linkage for the SDK rather than distributing
cannam@239 35 it as a DLL, particularly when building plugins.)
cannam@239 36
Chris@489 37 - build/VampExamplePlugins.vcxproj
cannam@239 38
cannam@239 39 This builds the example plugins DLL, but does not build the plugin
cannam@239 40 or host SDKs or the host. You don't need to build the plugin SDK
cannam@239 41 before this, because this project simply includes the plugin SDK
cannam@239 42 files rather than using the library.
cannam@239 43
Chris@489 44 - build/VampHostSDK.vcxproj
Chris@489 45
Chris@489 46 This builds the host SDK into a single static library, but does not
Chris@489 47 build the plugin SDK, example plugins, or host.
Chris@489 48
Chris@489 49 - build/VampSimpleHost.vcxproj
Chris@489 50
Chris@489 51 This builds the simple host command line program. You must have
Chris@489 52 the libsndfile library installed in order to build this project.
Chris@489 53
cannam@239 54 Of course, when using Visual Studio or another IDE to build a plugin
cannam@239 55 or host using the SDK, you may simply add the .h and .cpp files in the
cannam@239 56 vamp-sdk or vamp-hostsdk directories to your existing project. This
cannam@239 57 is the approach taken in the VampExamplePlugins project.
cannam@239 58
cannam@239 59
cannam@239 60 Installing the Example Plugins
cannam@239 61 ------------------------------
cannam@239 62
cannam@239 63 To install the example plugins so you can load them in Vamp hosts,
cannam@239 64 copy the files
cannam@239 65
cannam@239 66 build\release\vamp-example-plugins.dll
cannam@239 67 and
cannam@239 68 examples\vamp-example-plugins.cat
cannam@239 69
Chris@489 70 to the appropriate location as follows:
Chris@489 71
Chris@489 72 * For 32-bit plugins running on a 32-bit system, and
Chris@489 73 for 64-bit plugins running on a 64-bit system
cannam@239 74
cannam@239 75 C:\Program Files\Vamp Plugins
cannam@239 76
Chris@489 77 * For 32-bit plugins running on a 64-bit system
Chris@489 78
Chris@489 79 C:\Program Files\Vamp Plugins (x86)
Chris@489 80
Chris@489 81 You cannot use 64-bit plugins on a 32-bit system.
Chris@489 82
cannam@239 83
cannam@239 84 Plugin Linkage
cannam@239 85 --------------
cannam@239 86
cannam@239 87 Vamp plugins are distributed as dynamic libraries (DLLs). A properly
cannam@239 88 packaged Vamp plugin DLL should export exactly one public symbol,
cannam@239 89 namely the Vamp API entry point vampGetPluginDescriptor.
cannam@239 90
cannam@239 91 One nice tidy way to achieve this with Visual Studio is to add the
cannam@239 92 linker option /EXPORT:vampGetPluginDescriptor to your project. (All
cannam@239 93 of the other symbols will be properly hidden, because that is the
cannam@239 94 default for the Visual Studio linker.) The included example plugins
Chris@489 95 project in build/VampExamplePlugins.vcxproj does this.
cannam@239 96
cannam@239 97 Alternatively, you may modify vamp/vamp.h to add the
cannam@239 98 __declspec(dllexport) attribute to the vampGetPluginDescriptor
cannam@239 99 declaration. This is not present by default, because it isn't
Chris@489 100 portable among compilers and, as we only want one symbol exported, the
Chris@489 101 above linker option works equally well without code changes.
cannam@239 102
cannam@239 103 (If you don't take at least one of these actions, your plugin library
cannam@239 104 simply will not load in any host.)
cannam@239 105
cannam@239 106
cannam@239 107 Using MinGW/Cygwin
cannam@239 108 ------------------
cannam@239 109
cannam@239 110 Refer to README.linux for build instructions using the GNU toolchain.
cannam@239 111
cannam@291 112
cannam@291 113 Test Your Plugins
cannam@291 114 -----------------
cannam@291 115
cannam@291 116 The Vamp Plugin Tester is a vital utility which you can use to test
cannam@291 117 your plugins for common problems. It can help you if you're having
cannam@291 118 problems getting your plugin to work at all, and you're strongly
cannam@291 119 advised to use it before you release anything. Download it from the
cannam@291 120 Vamp plugins site now!
cannam@291 121