- Home /
DllNotFoundExeption: Help
In my project I created a Plugins folder (named it "Plugins", of course) and in it I have three plugins that get imported from my c++ project. Every time I hit build content I have my dlls show up into the "Plugins" folder.
The things is that I get a DllNotFoundExeption every time I run the game and it points to two out of my three plugins. Me and my teammates found online that you can solve this by placing the dlls in the the Assets folder. We did so, and as luck would have it, that solved it, by moving the two dlls that were giving us the error it solved it. We left the one dlls that was fine where it was inside the Plugins folder.
But something was nagging at the back of my head that this would not solve our entire issue, and I was right. When w build the game and create our executable only one dll gets built, which is the only one that is within the Plugins folder.
My question is: how do I fix my other two dlls so I don't get that DllNotFoundExeption error?
UPDATED REPORT I found that the one dll that works is done in C# while the other two that don't seem to work inside the Plugins folder are made in C++.
So my new question is how do I get Unity to accept those two dlls within the Plugins folder, or is that not possible for c++ plugins?
Is your Plugins folder inside Asset folder? If not move it inside Asset folder then build.
Answer by Kolodej · Jan 15, 2014 at 05:40 PM
Hi, if you want to use c++ libraries in Unity, you have to expose their methods via .net wrapper. You can find a lot of articles about that [c++ plugins for unity].
Example:
public class Wrapper {
DllImport ("PluginName")]
public static extern int ExposedPluginMethod();
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613130519im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Having issues using my .dlls 1 Answer
Distribute terrain in zones 3 Answers
Multiple Cars not working 1 Answer
How to get Unity to detect my own touch events 0 Answers
A node in a childnode? 1 Answer