Skip to content

Instantly share code, notes, and snippets.

@abique
Created October 1, 2014 18:05
Show Gist options
  • Save abique/6687c0cce4f34556196d to your computer and use it in GitHub Desktop.
Save abique/6687c0cce4f34556196d to your computer and use it in GitHub Desktop.
Load Vst
#include <stdio.h>
#include <dlfcn.h>
int main(int argc, char **argv)
{
void * handle = dlopen(argv[1], RTLD_NOW | RTLD_LOCAL);
if (!handle) {
fprintf(stderr, "failed to load %s: %s\n", argv[1], dlerror());
return 1;
}
union {
void *ptr;
} symbol;
symbol.ptr = dlsym(handle, "VSTPluginMain");
if (!symbol.ptr) {
fprintf(stderr, "symbol not found: VSTPluginMain\n");
return 1;
}
dlclose(handle);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment