- Home /
OpenGL causing DllNotFoundException on OSX
Hi,
I am running the trial of unity pro 4.2.1f4 to see if it's a viable option for an upcoming gig at work. We are interested in using libcinder.org within a native plugin. OSX for now although windows soon. I have run the following example fine: http://docs.unity3d.com/Documentation/Manual/NativePluginInterface.html
but to recompile it I must change
#include <OpenGL/OpenGL.h>
to
#include <OpenGL/gl.h>
(both are in the OpenGL.framework)
However, after compiling it with Xcode 5 on OSX 10.8.5 successfully I place it in the Plugins folder and I get 'DllNotFOundException' error that points to the correct path of the bundle. From my googlings it seems this may be due to dependancies but I find this strange given the above was the only change I made to the example.
Any advice? I have no problem including libcinder and compiling but I get the same error so hopefully resolving the simpler issue above will fix this too.
Best, nay.
If helpful my code is now here: https://github.com/naychrist/Cinder-UnityPlugin
the RenderingPluginExample folder is the same as the unity example. Inside there is an XCode3 folder with the original code and an XCode5 folder with my tweaks to get it compile.
The RenderingPlugin folder contains an XCode5 project that includes libcinder.org. If you have libcinder.org installed just point the $CINDER_PATH user defined variable to it in the project settings and it should compile.
Please don't post a comment as an answer. I converted it to a comment for you :)
Answer by nay · Oct 14, 2013 at 03:17 AM
So it turns out that despite documentation regarding universal binaries the plugin will only load correctly if 32 bit when compiled with XCode 4.6 or 5 using any of the available compilers (LLVM 4.2, LLVM GCC 4.2, LLVM 5.0). I assume this is a Unity bug although at least I can get it to work for my purposes at the moment.
One other very annoying bug that came up is that Unity will only detect changes to the plugin when I reimport all assets (the refresh command does not work). This makes for incredibly slow development.
I have filed bug reports relating to both of these issues ( 569289 and 569290 ).
This is still happening with 4.5. I was pulling my hair out trying to figure out why my plugin worked only when compiled for 32 bit, then I changed it back to Universal and it still worked. Seriously, Unity, how hard is it to change one line in your documentation after all this time? Unity only importing the plugin on reimport all is a nasty, nasty bug that will give many an ulcer.
[1]: http://docs.unity3d.com/$$anonymous$$anual/PluginsForDesktop.html
Your answer
Follow this Question
Related Questions
Using CVOpenGLTextureCache in Plugin on OSX - Get correct OpenGL context? 0 Answers
How can I build the rendering plugin example on OS X 10.10? 1 Answer
Rendering Android native view with OpenGL 0 Answers
ARB_sparse_texture support iOS / OSX 1 Answer
Auto fade between scenes in unity not working on OSX 0 Answers