Help me build the Steinberg's default examples in VS

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

I am new to C++, can someone help me setup the Steinberg's again example in VS?

An endless stream of errors of include directories gone wrong or an unresolved symbol error occurs when the project is debugged. All I did was drag and drop the project file (again and again.h) into the source/header files, and include the VST3_SDK in c++ include directories. Complete nightmare...

Post

I remember having same type issue with VS+VST but as that was few years ago....

Have you checked if all dependencies are set properly (Project properties)?

Post

juha_p wrote:I remember having same type issue with VS+VST but as that was few years ago....

Have you checked if all dependencies are set properly (Project properties)?
Thank you Juha.

No I am not at all sure that they are set properly. I have:

kernel32.lib
user32.lib
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
odbccp32.lib

as inherited values (Linker/Input/Additional dependencies). I have also added:

shell32.lib
msvcrtd.lib
ole32.lib
gdi32.lib
User32.lib
advapi32.lib

And in the same options menu ignore specific:

libcmt.lib
libcmtd.lib
msvcrt.lib

Post

NOTHING works... Steinberg's guide is out of date talking about three .(h)cpp files, when there are 15 project files in the actual example directory. It doesn't seem to matter how many are dragged and dropped into the project, and ".stdio.h" does not even exist anywhere in the directory, yet the again.cpp has it as an include file. I wonder if these examples are functional in the first place. Any help is very welcome!

Post

Earlier versions of the SDK contained .sln files for the example projects which you could open in VS and it built out of the box (for me).

Now, *I think* (haven't looked into the latest SDK version in detail) .sln files are no longer included and the intended way to build the examples is to create the the .sln files with CMake first and then open these with VS. (someone more familiar with latest SDK please correct me if wrong).

Post

No_Use wrote:Earlier versions of the SDK contained .sln files for the example projects which you could open in VS and it built out of the box (for me).

Now, *I think* (haven't looked into the latest SDK version in detail) .sln files are no longer included and the intended way to build the examples is to create the the .sln files with CMake first and then open these with VS. (someone more familiar with latest SDK please correct me if wrong).
You are right, there is a tutorial.sln file included (and few others). This one won't even get past compile stage, it's full of errors. :roll:

I will give the CMake route a shot.

Post

I just gave the latest SDK a look, what worked for me building again:

- download & run CMakeGUI (there's also a command line version, but I find the GUI version easier to use. edit: correction, I think the GUI is included in the regular CMake install already, been some time since I installed it).
Set the paths and click 'Configure', should look something like this:

Image

Click "Generate", this creates the .sln file
After done, click "Open Project". This should open VS with the example projects from where you can build.

Image



-

Post

No_Use wrote:I just gave the latest SDK a look, what worked for me building again:

- download & run CMakeGUI (there's also a command line version, but I find the GUI version easier to use. edit: correction, I think the GUI is included in the regular CMake install already, been some time since I installed it).
Set the paths and click 'Configure', should look something like this:

Image

Click "Generate", this creates the .sln file
After done, click "Open Project". This should open VS with the example projects from where you can build.

Image



-

Thank you sooo much! You win the internet. :tu:

Just interested, what VST hosts do you use for debugging?

Post

No_Use wrote:I just gave the latest SDK a look, what worked for me building again:

- download & run CMakeGUI (there's also a command line version, but I find the GUI version easier to use. edit: correction, I think the GUI is included in the regular CMake install already, been some time since I installed it).
Set the paths and click 'Configure', should look something like this:

Image

Click "Generate", this creates the .sln file
After done, click "Open Project". This should open VS with the example projects from where you can build.

Image



-

Thank you sooo much! You win the internet. :tu:

Just interested, what VST hosts do you use for debugging?

Post

You're welcome. I've been through these 'getting started stepping stones' also at some point so I know how it feels. (You can send the internet to my paypal account btw. :lol: )

Since I use Reaper as my main DAW I also use it for debugging.

Btw, if you want to start making your own plugins I'd suggest having a look at iPlug and JUCE frameworks which can make life significantly easier than developing from scratch using pure VST SDK.

Post

No_Use wrote:You're welcome. I've been through these 'getting started stepping stones' also at some point so I know how it feels. (You can send the internet to my paypal account btw. :lol: )

Since I use Reaper as my main DAW I also use it for debugging.

Btw, if you want to start making your own plugins I'd suggest having a look at iPlug and JUCE frameworks which can make life significantly easier than developing from scratch using pure VST SDK.
What's your address?

Can Reaper take these .dll's as arguments? At this stage I may want to debug a lot...

Post

In VS I've created a Post-Build Event so that it copies the built plugin binary to my plugins folder.

And under "Debugging" it's set up like this (no need to pass .dll's as arguments):

Image

$(VST2_32_HOST_PATH) can also be an absolute path to your host.exe.

This is a WDL/iPlug project, setting up described here in detail:
http://www.martin-finke.de/blog/article ... st-and-au/

Post

I've been digging into this for the first time. VS2017 includes CMake functionality, which is apparently new (I usually work in c#, haven't done much with c++). Anyway, instead of CMakeGUI, you can use "File | Open | Folder..." in VS2017 to open the "\VST_SDK\VST3_SDK" folder. In the solution explorer, right click on CMakeLists.txt and choose, "Change CMake Settings". This will create and open a json file "CMakeSettings.json" that you can use to configure CMake for each configuration (x86/x64 debug/release). I wanted to build VST2's and I figured out I can do this by:

Code: Select all

...
      {
        "name": "x64-Release",
        "generator": "Visual Studio 15 2017 Win64",
        "configurationType": "Release",
        //"buildRoot":  "${env.LOCALAPPDATA}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
        // put the build output in the SDK folders for my own convenience
        "buildRoot": "${projectDir}\\build\\${name}",
        "cmakeCommandArgs": "",
        "buildCommandArgs": "-m -v:minimal",
        "ctestCommandArgs": "",
        //turn VST2 ON or OFF here
        "variables": [
          {
            "name": "SMTG_CREATE_VST2_VERSION:BOOL",
            "value": "ON"
          }
        ]
      }
...
This is where you can set the build output folder ... but it doesn't seem like you have to tell it where to find the source files. Once you save this, you can right click on "CMakeLists.txt" again in solution explorer, and tell it to build the CMake cache. Although you can set all the build configurations in the same single json file, it seems like you have to build the CMake caches one at a time (i.e. VS will only build the cache for the currently selected VS config - ie "x64-Release").

Post

cpnet wrote:I've been digging into this for the first time. VS2017 includes CMake functionality, which is apparently new (I usually work in c#, haven't done much with c++). Anyway, instead of CMakeGUI, you can use "File | Open | Folder..." in VS2017 to open the "\VST_SDK\VST3_SDK" folder. In the solution explorer, right click on CMakeLists.txt and choose, "Change CMake Settings". This will create and open a json file "CMakeSettings.json" that you can use to configure CMake for each configuration (x86/x64 debug/release). I wanted to build VST2's and I figured out I can do this by:

Code: Select all

...
      {
        "name": "x64-Release",
        "generator": "Visual Studio 15 2017 Win64",
        "configurationType": "Release",
        //"buildRoot":  "${env.LOCALAPPDATA}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
        // put the build output in the SDK folders for my own convenience
        "buildRoot": "${projectDir}\\build\\${name}",
        "cmakeCommandArgs": "",
        "buildCommandArgs": "-m -v:minimal",
        "ctestCommandArgs": "",
        //turn VST2 ON or OFF here
        "variables": [
          {
            "name": "SMTG_CREATE_VST2_VERSION:BOOL",
            "value": "ON"
          }
        ]
      }
...
This is where you can set the build output folder ... but it doesn't seem like you have to tell it where to find the source files. Once you save this, you can right click on "CMakeLists.txt" again in solution explorer, and tell it to build the CMake cache. Although you can set all the build configurations in the same single json file, it seems like you have to build the CMake caches one at a time (i.e. VS will only build the cache for the currently selected VS config - ie "x64-Release").
I tried this, and it didn't quite work. I assume there are some files missing from the directory, for example the lib/debug directory is empty (for debug build).

That being said, the graphics don't work in the debug x64 build even in the cmake version (didn't try other versions). I also tried copying the same files to a new project and using the same settings. Now it at least builds, but the .vst3 crashes on plugin scan. Probably has something to do with the fact that I didn't nor does VS allow me to include the references.

Steinberg did such a bad job with the documentation. The way too few lines of comments that document anything are full of spelling mistakes that would make internet trolls proud.. not good.

Post

Ok I have now checked every example plugin, both debug/release versions, and the UI's just plain won't work. Any ideas?

Image

Note that in CMake I used the Visual Studio 15 2017 64-bit option.

Post Reply

Return to “DSP and Plugin Development”