COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 03-14-2018, 06:03 PM   #1
Derek Sapfe
Human being with feelings
 
Join Date: Jan 2018
Posts: 5
Default Reaper won't load plugin DLL

Hello,

I was going to implement a new version check for my first plugin. For this I used libcurl (https://curl.haxx.se/libcurl/c/libcurl.html) and restclient-cpp (https://github.com/mrtazz/restclient-cpp).

Simply the plugin's version number is sent to HTTP server which responds 1 for new updated available or 0 for no new version.

I have compiled the libcurl DLL from the latest sources.

When I run the plugin from Visual Studio it works correctly and checks for a new version.

When I compile VST2 DLL I have my plugin DLL and libcurl.dll in the same directory. When I load the plugin to Hermann Seib's VST Host (http://www.hermannseib.com/english/vsthost.htm) it works correctly.

However, when I try to load the plugin in Reaper I get "The program can't start because libcurl.dll is missing from your computer. Try reinstalling the program to fix this problem." and the plugin won't load.

Somehow Reaper can't read the libcurl.dll from the plugin's directory? Or could it be some compatibility issue with the DLL? I have searched the net for solutions but just can't get it working.

Any help is appreciated!
Derek Sapfe is offline   Reply With Quote
Old 03-14-2018, 07:20 PM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,107
Default

Quote:
Originally Posted by Derek Sapfe View Post
Somehow Reaper can't read the libcurl.dll from the plugin's directory?
In Reaper, plugin dlls will unfortunately end up searching linked dlls in the directory where reaper.exe itself is located. While you could use that for testing yourself, you obviously can't make a released product behave that way.

Some options :

1) Load the libcurl.dll dynamically in your plugin with LoadLibrary, GetProcAddress etc instead of using the dll loading .lib file. Painful if you need to use lots of functions from the dll. Note that a relative path to the libcurl.dll is likely not going to work, you will need to form the full absolute path to the dll to be sure LoadLibrary will be able to find it.
2) Install the libcurl.dll in the Windows system directories. Quite nasty. I would personally hate a plugin that did that.
3) Investigate if there's any way to just compile the libcurl source code directly into your plugin or statically link into it.
4) Use something else than libcurl. WDL contains some network access stuff. (jnetlib)

I would probably go with option 4 myself, I strongly dislike libraries that force having to use them via dlls on Windows. (Or make it very hard to use them in any other way.)
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/
Xenakios is offline   Reply With Quote
Old 03-14-2018, 11:56 PM   #3
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 1,898
Default

Or build libcurl as a static library.

Code:
nmake /f Makefile.vc mode=static RTLIBCFG=static MACHINE=x64
cfillion is online now   Reply With Quote
Old 03-16-2018, 04:25 AM   #4
Derek Sapfe
Human being with feelings
 
Join Date: Jan 2018
Posts: 5
Default

I ended up using Windows functionality for the HTTP call (https://stackoverflow.com/questions/...request-with-c).

There is also another DLL that I have to use. That one I used dynamically.

Many thanks for the replies!
Derek Sapfe is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:59 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.