I just finished to make a VST project with C::B and VST 2.4.
It compiles and the DLL has the right exported functions (this was much trouble).
I have only 1 VST host installed in my system: it sees the plugin, read name/channels/... informations correctly, but does not give me the possibility to use it and I don't know why. (May be incompatibilities with 2.4 version???)
If you give me an email, I can send you the project and the DLL, so you can try it and say me if it works for you.
Could you please send that project to me, too? I've been wrestling with C::B, VC++2003 Toolkit and the VST2.4 SDK since yesterday. While I finally got everything to compile okay, the plugins aren't recognized by my VST hosts (most likely a problem with the symbol exports).
And could you make that project available for download? I'm sure it would help a few other people over the initial problems with setting up a VST coding environment.
SDK source files
That files must be added because you can only specify directories for "include" files, generally header ".h" files.
This is to compile, but to have an executable, you need the object files to make the linker work.
To have object files, you must compile the SDK files.
This can be done only including the source files in the project (so they are compiled).
At least this is what I know.
I don't like this, but it is needed, as far as I know.
Anyway VisualStudio projects (bundled in the SDK) include SDK source files in the project too, so I think they are really needed.
If someone knows how to avoid including SDK source files in each project, please let us know!
I think this can be done, but the solution requires some manual work.
The key to the solution: you can pass object files manually to the linker; just add the filename (with complete path, absolute or relative) to the "Build Options"-"Linker/Other linker options" list. This gets treated like just any other argument, and is passed directly to the linker argument list when the linker is called. So you can add any object file to the linking stage without it being part of the current C::B project.
Applying this to VST projects: you need a precompiled .obj file for each of the VST SDK .cpp's you want to use, so that you can pass it to the linker in your other VST projects. I'd recommend setting up a special project which just compiles all the .cpp files in the VST SDK without linking anything.
If you want to build both release and debug versions, create separate object dirs for both variants, one for normal object files, the other compiled with debug settings.
To make a "clean" VST project, add all the required VST SDK object files from our "object-only" project to the linker options and remove each of the corresponding .cpp files from the project. This is important! If you don't remove the .cpp, the linker will compile the file and try to link both the project-internal .obj and the external one, which gives linking errors ("symbol XXX already defined in file XXX").
If you do both release and debug builds, you have to add the appropriate object files to both build targets.
If you compile now, the DLL should be built just as before - all external symbol references are resolved by the object files we are passing directly to the linker.
This results not only in a cleaner project view in the Management pane, but also avoids that the SDK sources are being recompiled each time you do a full rebuild.