What is vstplug.def?
-
- KVRist
- Topic Starter
- 154 posts since 15 Feb, 2012
I have a question about a specific VST project on github. It is found here...
https://github.com/gijzelaerr/gijzelijzer
I am trying to compile my first vst plugin, and I am using this project as a guide.
My question is simple. What are the files in the resource folder for?
the .rc , .vstxml, and vstplug.def
https://github.com/gijzelaerr/gijzelijzer
I am trying to compile my first vst plugin, and I am using this project as a guide.
My question is simple. What are the files in the resource folder for?
the .rc , .vstxml, and vstplug.def
- KVRAF
- 15273 posts since 8 Mar, 2005 from Utrecht, Holland
See this MSDN article.
Resources can be icons, bitmaps, static xml config files and whatever the software needs that is not code which needs compilation.
Resources can be icons, bitmaps, static xml config files and whatever the software needs that is not code which needs compilation.
We are the KVR collective. Resistance is futile. You will be assimilated.
My MusicCalc is served over https!!
My MusicCalc is served over https!!
-
- KVRian
- 573 posts since 1 Jan, 2013 from Denmark
Specifically, the vstplug.def file exports the entry function for the plugin to have a standardized name, the host can find. Otherwise the plugin probably wont load.
Code: Select all
EXPORTS
VSTPluginMain
main=VSTPluginMain
-
- KVRist
- Topic Starter
- 154 posts since 15 Feb, 2012
Is this specific to Visual studio projects?
I am building using MingGW and make. Will I have to use makes method for exporting functions in the dll?
I am building using MingGW and make. Will I have to use makes method for exporting functions in the dll?
-
- KVRian
- 573 posts since 1 Jan, 2013 from Denmark
I'm actually not quite sure. The host doesn't care whatever build the DLL as long as it can find the exported function, so you would probably have to ensure it anyway, somehow.Ap0C552 wrote:Is this specific to Visual studio projects?
I am building using MingGW and make. Will I have to use makes method for exporting functions in the dll?
-
- KVRist
- Topic Starter
- 154 posts since 15 Feb, 2012
I am confused in regards to the function/class being exported for the dll.
In vstplug.def it says main=VSTPluginMain. But that function or class does not exist anywhere in the project.
View the src here...
https://github.com/gijzelaerr/gijzelijz ... master/src
EDIT: Apparently according to this
http://hans.fugal.net/blog/2006/07/29/v ... n-mingw32/
the .defs file is also accepted by MinGW....
My vst dll is not being regonized by host, and I thought it was because it was no exporting the proper functions...
In vstplug.def it says main=VSTPluginMain. But that function or class does not exist anywhere in the project.
View the src here...
https://github.com/gijzelaerr/gijzelijz ... master/src
EDIT: Apparently according to this
http://hans.fugal.net/blog/2006/07/29/v ... n-mingw32/
the .defs file is also accepted by MinGW....
My vst dll is not being regonized by host, and I thought it was because it was no exporting the proper functions...
-
- KVRian
- 573 posts since 1 Jan, 2013 from Denmark
Its probably the cause. VSTPluginMain is defined in vstsdk2.4/public.sdk/source/vst2.x/vstplugmain.cpp
That function calls createEffectInstance, which you need to defined. Either you haven't included all the necessary source files from the SDK. or you messed up the exported name.
That function calls createEffectInstance, which you need to defined. Either you haven't included all the necessary source files from the SDK. or you messed up the exported name.
-
- KVRist
- Topic Starter
- 154 posts since 15 Feb, 2012
Is there a way to diagnose for sure that proper fucntions are not being exported?Mayae wrote:Its probably the cause. VSTPluginMain is defined in vstsdk2.4/public.sdk/source/vst2.x/vstplugmain.cpp
That function calls createEffectInstance, which you need to defined. Either you haven't included all the necessary source files from the SDK. or you messed up the exported name.
If I have not included all the neccessary source files, I don't think it would compile successfully, correct?
Also, what do you mean by "exported name"?
This is what my CmakeLists.txt looks like...
Code: Select all
cmake_minimum_required(VERSION 3.4)
project(MyFirstVst)
#install(TARGETS MyFirstVst DESTINATION bin)
#-------------------------------------------------------------------------------
# Find External libs
#-------------------------------------------------------------------------------
SET(VST_DIR C:/VstSDK)
SET(VSTSDK_PLUGIN_SOURCE
${VST_DIR}/public.sdk/source/vst2.x/audioeffectx.cpp
${VST_DIR}/public.sdk/source/vst2.x/audioeffect.cpp
${VST_DIR}/public.sdk/source/vst2.x/vstplugmain.cpp
)
#-------------------------------------------------------------------------------
# Set what to compile how
#-------------------------------------------------------------------------------
SET(MYFIRSTVST_SOURCE
src/MyFirstVst.cpp
src/MyFirstVst.h
src/main.cpp
resources/myfirstvst.rc
resources/vstplug.def
${VSTSDK_PLUGIN_SOURCE}
)
ADD_LIBRARY(MyFirstVst SHARED ${MYFIRSTVST_SOURCE})
#-------------------------------------------------------------------------------
# Include external libs
#-------------------------------------------------------------------------------
INCLUDE_DIRECTORIES(
Utility
${VST_DIR}
)
-
- KVRist
- 153 posts since 8 May, 2007 from California
To verify your exports, you could use Dependency Walker: http://www.dependencywalker.com/
-
- KVRist
- Topic Starter
- 154 posts since 15 Feb, 2012
Dependency Walker just gave errors on any dll and I was not sure how to use it.
Here is what happens when I load Epicverb plug in. Not sure what to make of all this.
https://www.dropbox.com/s/oggwjzt57haj6 ... r.png?dl=0
I also tried http://www.nirsoft.net/utils/dll_export_viewer.html
When I open a know to be working dll is says exported function name is simply "main".
When I open my dll it says the exact same thing.
Here is what happens when I load Epicverb plug in. Not sure what to make of all this.
Code: Select all
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
Warning: At least one module was corrupted or unrecognizable to Dependency Walker, but still appeared to be a Windows module.
I also tried http://www.nirsoft.net/utils/dll_export_viewer.html
When I open a know to be working dll is says exported function name is simply "main".
When I open my dll it says the exact same thing.
- KVRAF
- 12555 posts since 7 Dec, 2004
Don't use a VST plug-in to learn basic c/c++ and programming.
It sounds to me like you're having a lot of trouble on the compiler side. Likely with linkage and linkage options.
.def files are a visual studio way to pass linker commands as a file. You can actually do the same using the right compiler-specific pragma statements in the source, and by prototyping your functions correctly.
This sort of thing will also work:
As far as I'm aware this works the same way as the source containing the exports from the "VST SDK", only it doesn't write an alternate name using the linker but rather exports a duplicate function body.
It sounds to me like you're having a lot of trouble on the compiler side. Likely with linkage and linkage options.
.def files are a visual studio way to pass linker commands as a file. You can actually do the same using the right compiler-specific pragma statements in the source, and by prototyping your functions correctly.
This sort of thing will also work:
Code: Select all
vst::AEffect *getVst(vst::audioMasterCallback audioMaster);
#if defined(_WIN32)
#define EXPORT extern "C" __declspec(dllexport)
#else
#define EXPORT extern "C"
#endif
EXPORT vst::AEffect *MAIN(vst::audioMasterCallback audioMaster)
{
return getVst(audioMaster);
}
EXPORT vst::AEffect *VSTPluginMain(vst::audioMasterCallback audioMaster)
{
return getVst(audioMaster);
}
Last edited by aciddose on Wed Nov 11, 2015 9:46 pm, edited 1 time in total.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
-
- KVRist
- Topic Starter
- 154 posts since 15 Feb, 2012
- KVRAF
- 12555 posts since 7 Dec, 2004
So you understand how to work with compilers, build libraries and so on? That is the important bit. If you don't know how to configure the compiler to export a function in the right format you'lll run into trouble.
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
-
- KVRist
- Topic Starter
- 154 posts since 15 Feb, 2012
Somewhat. Don't confuse being uncomfortable with foreign build systems, with being new to c++. I have worked for 1.5 year full time as a C++ developer on the Android Platform, in more junior position. If you have trouble building a NativeActivity on Android using the Android NDK build system, I could probably help you. But I have not got much exposure to different build systems like Cmake (this is my first attempt) or building a dll (my first attempt) as well. But my knowledge of the C++ is not beginner. I would like to think intermediate.aciddose wrote:So you understand how to work with compilers, build libraries and so on? That is the important bit. If you don't know how to configure the compiler to export a function in the right format you'lll run into trouble.
To get back on topic. I decided to have cmake output a visual studio sln instead. I built with visual studio, and it built properly. But again did not load in my host.
I get a bunch of warnings though....
Code: Select all
2>LINK : warning LNK4044: unrecognized option '/lkernel32'; ignored
2>LINK : warning LNK4044: unrecognized option '/luser32'; ignored
2>LINK : warning LNK4044: unrecognized option '/lgdi32'; ignored
2>LINK : warning LNK4044: unrecognized option '/lwinspool'; ignored
2>LINK : warning LNK4044: unrecognized option '/lshell32'; ignored
2>LINK : warning LNK4044: unrecognized option '/lole32'; ignored
2>LINK : warning LNK4044: unrecognized option '/loleaut32'; ignored
2>LINK : warning LNK4044: unrecognized option '/luuid'; ignored
2>LINK : warning LNK4044: unrecognized option '/lcomdlg32'; ignored
2>LINK : warning LNK4044: unrecognized option '/ladvapi32'; ignored
Last edited by Ap0C552 on Wed Nov 11, 2015 10:00 pm, edited 1 time in total.
- KVRAF
- 12555 posts since 7 Dec, 2004
Talk to me in another 13.5 years if you want to talk about what constitutes "beginner".
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.