Pergunta

I am currently working on a Unity3d 4.0 Pro project where i am trying to link the tngaming vest to unity. The only SDK ( http://tngames.com/pages/Developers ) i have available is a C++ .h and a .lib file. As far as i understand from the documentation ( http://docs.unity3d.com/Documentation/Manual/Plugins.html ), i should simply put the two tngaming.h and tngaming.lib into my assets folder and do the following code:

[DllImport("tngaming")]
private static extern int SetUpJacket();

And that would allow me to call the function SetUpJacket(). However i get the DllNotFoundException: tngaming error.

Anyone who got some information doing something similar who can help out?

Foi útil?

Solução

Thank you all for your assistance.. The actual goal was to find a way to change unmanaged c++ code (.h and .lib file) to a unmanaged .dll and then create a c# wrapper..

It took a lot of very obscure searching but i managed to find a page that did exactly what i needed in a guide form.

http://waterhobo.com/?p=28

At the bottom of the page, there is a link in the line "Here is the source code i made" for those who want to skip the programming parts and just use the TN Gaming Vest in C#.

Outras dicas

From http://docs.unity3d.com/Documentation/Manual/PluginsForDesktop.html

Once built, the bundle should be placed in the Assets->Plugins folder in the Unity project. Unity will then find it by name.

MacOS libraries are .lib, Windows libraries are .dll, and Linux libraries are .so. The other commenters are incorrect; plugins do not have to be in .dll format. I believe (not sure) that .dll's will work on Mac as well.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top