I’m just starting with writing VCV Rack plugins.
And I want to bring in some C++ code I already used in other projects, into my plugin.
What’s the best way to do that?
I tried making it as a Linux static library, putting a symlink to a directory containing it, under the src directory where I’m developing my plugin code, and adding the following to the Makefile
CXXFLAGS += Lmylibpath
LIBS = mylibname
and including in my header file
#include "mylib/myheader.hpp"
Calling make
in the plugin directory seems to work OK.
But when I make run
in the main Rack directory to run the whole of Rack including my plugins (which is how I normally see them running), Rack fails to load with
Failed to load library ./plugins/MyPlugin/plugin.so: ./plugins/MyPlugin/plugin.so: undefined symbol: _ZN3mylib12PhaseCounter5startEff
The PhaseCounter object comes from my library. And is in its own namespace. All of which I seem to be handling OK in the plugin itself. It does seem to compile without error.
But Rack doesn’t seem to be able to see it.
Anyone have any ideas why?