I'm writing a C++ plugin DLL for a 3rd-party Windows application. My plugin DLL can live anywhere on the file system and I specify where it is when loading it from the 3rd-party app.
Part of the functionality of my DLL requires me to use a 3rd party library (ZeroMQ). I linked my DLL to the ZeroMQ library and it built correctly. However, upon loading my DLL in the 3rd party app I kept getting a The specified module could not be found.
error. Initially it wasn't clear to me if I used the ZeroMQ static lib if I needed the zeromq DLL as well or not (but apparently it's common to have a static lib that wraps access to the DLL: Using .dll in Visual Studio 2010 C++).
I tried putting the zero mq dll (libzmq-v100-mt-gd-3_2_2.dll in my case) in the same folder as my plugin DLL, however this did not work.
Finally by sheer experimentation I found I could put the zeromq dll directly in the same folder as the main 3rd-party application and now my plugin works. However, ideally I'd rather not do that. Is there a way for me to somehow put the zeromq dll library in the same folder as my plugin DLL? And if so, how? Perhaps some configuration option in Visual Studio when building my DLL?