How to include a DLL in plugins

How do I include an existing DLL into a Xojo plugin?

The latest OpenGL plugin is very impressive, with code literally being 5 years old and impressive programs have been made. To modify code on the graphics card, the GLEW library is required, and is there a way that I can include the GLEW32.dll in the plugin? Code works in Visual Studio 2022 C++.

I guess I could rewrite the code from C to C++ for the plugin - which is alot of work, and am just looking for an easier solution. Current code has about 450 methods and about 900 constants to make programming easier with a plugin.

When I place the dll in a zipped xojo_plugin file, Xojo attempts to load the extra dll it and creates an error. It appears this topic was brought up before at: How to Include extra DLL in Plugin?

If this isn’t possible, then is there a workaround to make this work?

I don’tt think they ever implemented support for including DLL like that (not that I know of at least).

The other part where you talk of rewriting c code to c++, that part I do not get at all. You do know that c code can live together with C++ code… right ?? …You just do extern “C” { your include here }

Ok, just checking to see if I missed something over the years :slight_smile:

Yes, this is a rather weird plugin. This is the GLEW library, where the multiple source code files in “C” are used to compile a single header file and a dll, in Windows. This is not a cut-and-paste thing, and rather determining the C-code that is used for building the dll and header file, and making a separate header file.

I will likely use GLAD instead, as the library is more modern and the C code can be included into the project.

Thanks for answering my question! :slight_smile:

Build a static library and link it into the plug-in.

1 Like

Thanks for the great suggestion Christian. I will look into building a static library.

Warm regards.