Created
October 1, 2014 18:05
-
-
Save abique/6687c0cce4f34556196d to your computer and use it in GitHub Desktop.
Load Vst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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