# Cross-platform means to access server files or mySQL from iPlug2?

**URL:** <https://iplug2.discourse.group/t/cross-platform-means-to-access-server-files-or-mysql-from-iplug2/812>\
**Category:** Made with iPlug2\
**Created:** [13 September 2023 16:27 UTC](https://iplug2.discourse.group/t/cross-platform-means-to-access-server-files-or-mysql-from-iplug2/812 "2023-09-13T16:27:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![RexMartin2](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@RexMartin2](https://iplug2.discourse.group/u/RexMartin2)\
**Post date:** [13 September 2023 16:27 UTC](https://iplug2.discourse.group/t/cross-platform-means-to-access-server-files-or-mysql-from-iplug2/812/1 "2023-09-13T16:27:08Z")

</div>

Many plugins check a database on-line for registration purposes (to check serial numbers, etc.) and I would like to add that function to my plugins.

I have looked into using mySQL Connector/C++ - and others - but I haven’t found a solution that is straightforward and cross-platform. For example, mySQL Connector/C++ seems to not be self-contained as it requires a DLL to be included with the published APP.

“Sockets” are another means to access webserver files - but again trying to get all this to work cross-platform - and now with ARM64 on Mac - seems quite a challenge.

Is there any particular method most suited for iPlug audio plugins?

---

<div class="post-metadata">

**Author:** ![Yomy](https://avatars.discourse-cdn.com/v4/letter/y/ea5d25/32.png) [@Yomy](https://iplug2.discourse.group/u/Yomy)\
**Post date:** [15 September 2023 19:12 UTC](https://iplug2.discourse.group/t/cross-platform-means-to-access-server-files-or-mysql-from-iplug2/812/2 "2023-09-15T19:12:20Z")

</div>

I use curl to do http get request from the server.

---

<div class="post-metadata">

**Author:** ![RexMartin2](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@RexMartin2](https://iplug2.discourse.group/u/RexMartin2)\
**Post date:** [15 September 2023 22:14 UTC](https://iplug2.discourse.group/t/cross-platform-means-to-access-server-files-or-mysql-from-iplug2/812/3 "2023-09-15T22:14:10Z")

</div>

Thank you. I have tried using curl - adding the necessary header and libraries, etc. - but the minute I add any curl function (such as curl\_init()) to my plugin code the plugin stops being recognized by any DAW, i.e., “curl” is somehow corrupting the plugin interface.

I’ve tried calling curl code from the plugin header as well as OnParamChange() with the same result.

So, where are you using curl code? Are you calling it inside the plugin or in an installer app _outside_ the plugin?

---

<div class="post-metadata">

**Author:** ![Yomy](https://avatars.discourse-cdn.com/v4/letter/y/ea5d25/32.png) [@Yomy](https://iplug2.discourse.group/u/Yomy)\
**Post date:** [18 September 2023 16:24 UTC](https://iplug2.discourse.group/t/cross-platform-means-to-access-server-files-or-mysql-from-iplug2/812/4 "2023-09-18T16:24:24Z")

</div>

I’m calling curl from my license control inside the plugin, when the user enter a serial number and click authorize.

did you add the extra linker flag?

---

<div class="post-metadata">

**Author:** ![RexMartin2](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@RexMartin2](https://iplug2.discourse.group/u/RexMartin2)\
**Post date:** [18 September 2023 18:57 UTC](https://iplug2.discourse.group/t/cross-platform-means-to-access-server-files-or-mysql-from-iplug2/812/5 "2023-09-18T18:57:11Z")

</div>

> [@Yomy](#):
>
> I’m calling curl from my license control inside the plugin, when the user enter a serial number and click authorize.

That’s exactly what I want to do. I know this is not an iPlug2 issue but I imagine a lot of folks here would like to know how to implement this in their plugins as well. Did you find an example of how to do this somewhere or did you create your own code from scratch?

> [@Yomy](#):
>
> did you add the extra linker flag?

Uh - probably not! I’m still trying to figure Curl out.

Is the curl interface completely embedded in the plugin code - or does it require curl DLL(s) and/or curl lib files to be delivered along with the plugin file?

---

<div class="post-metadata">

**Author:** ![Yomy](https://avatars.discourse-cdn.com/v4/letter/y/ea5d25/32.png) [@Yomy](https://iplug2.discourse.group/u/Yomy)\
**Post date:** [18 September 2023 20:28 UTC](https://iplug2.discourse.group/t/cross-platform-means-to-access-server-files-or-mysql-from-iplug2/812/6 "2023-09-18T20:28:19Z")

</div>

I have my own license control.  
Use curl static lib so there are no extra files you need to deliver.  
Here is an example of how to use it

> <https://stackoverflow.com/questions/44994203/how-to-get-the-http-response-string-using-curl-in-c>

---

<div class="post-metadata">

**Author:** ![RexMartin2](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@RexMartin2](https://iplug2.discourse.group/u/RexMartin2)\
**Post date:** [18 September 2023 21:13 UTC](https://iplug2.discourse.group/t/cross-platform-means-to-access-server-files-or-mysql-from-iplug2/812/7 "2023-09-18T21:13:59Z")

</div>

Awesome! Thank you very much for sharing this!

👍

---

<div class="post-metadata">

**Author:** ![RexMartin2](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@RexMartin2](https://iplug2.discourse.group/u/RexMartin2)\
**Post date:** [23 September 2023 19:47 UTC](https://iplug2.discourse.group/t/cross-platform-means-to-access-server-files-or-mysql-from-iplug2/812/9 "2023-09-23T19:47:21Z")

</div>

> [@Yomy](#):
>
> Use curl static lib so there are no extra files you need to deliver.

I’ve been working at this for several days and just can’t get it. I have included

```auto
#define CURL_STATICLIB 
#include <curl/curl.h>

```

but “#define CURL\_STATICLIB” has no effect and is still producing 2 dll files in addition to my plugin file:

MyPlugin.vst3  
**libcurl.dll**  
**zlib1.dll**

How do I get rid of/embed those curl dll files?

I tried installing the curl static libraries (vcpkg install curl:x64-windows-static) but apparently static packages don’t work in MSVC 2022. Seems that only the dll version works in MSVC 2022. The static version is unrecognized.

Haven’t tried any of this on Mac OS yet. One step at a time.

Any help here greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Yomy](https://avatars.discourse-cdn.com/v4/letter/y/ea5d25/32.png) [@Yomy](https://iplug2.discourse.group/u/Yomy)\
**Post date:** [23 September 2023 22:22 UTC](https://iplug2.discourse.group/t/cross-platform-means-to-access-server-files-or-mysql-from-iplug2/812/10 "2023-09-23T22:22:04Z")

</div>

You need to build or download a built version of curl static lib (preferably with SSL).  
Add the include folder to Additional Include Directories.  
Add the lib folder to the linker Additional Library Directories.  
Preprocessor Defenitions: CURL\_STATICLIB.  
Linker Additional Dependencies:  
libcurl\_a.lib  
Ws2\_32.lib  
Crypt32.lib  
Wldap32.lib  
Normaliz.lib

Just google how to build and use curl static.  
Good luck

---

<div class="post-metadata">

**Author:** ![RexMartin2](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@RexMartin2](https://iplug2.discourse.group/u/RexMartin2)\
**Post date:** [23 September 2023 23:10 UTC](https://iplug2.discourse.group/t/cross-platform-means-to-access-server-files-or-mysql-from-iplug2/812/11 "2023-09-23T23:10:11Z")

</div>

> [@Yomy](#):
>
> Linker Additional Dependencies:  
> libcurl\_a.lib  
> Ws2\_32.lib  
> Crypt32.lib  
> Wldap32.lib  
> Normaliz.lib

This is what I was missing! It works now. Thank you!!! 😀

I’m using vcpkg in MSVC 2022 and found I only needed to use three of those additional dependencies: Ws-32.lib, Crypt32.lib, and Wldap32.lib plus I had to set the vcpkg Target and Configuration Specific project setting “Use Static Libraries” to “Yes”. (I had already built and installed the static curl vcpkg but couldn’t figure out why it wasn’t working).
