I'm developing an augmented reality application and I'm supposed to use the ALVAR library for AR marker detection. I use Unity as the game engine and unfortunately it doesn't support C++. Is there any possible way to use the C++ library as a DLL?

| improve this question | | | | |
  • 1
    \$\begingroup\$ Calling into a C++ library from C# looks simple enough. Howerver ALVAR's website does not mention whether ALVAR is a static or dynamic library. Does ALVAR's SDK package contain .dll (or .so) files, or only .lib (or .a) files ? Also, are you on Windows or UNIX ? \$\endgroup\$ – Quentin Aug 25 '16 at 8:30
  • \$\begingroup\$ @Quentin: The link you specified is logical. I'll try it out. ALVAR SDK contain no .dll's. It has a collection of .cpp files. I use Windows platform. Thank you. \$\endgroup\$ – Sooraj K Babu Aug 25 '16 at 9:00
  • \$\begingroup\$ According to the documentation, you must be looking at the "src" package, not the SDK one (the SDK should have no .cpp files, only .h's). If the SDK package does not contain dll's, then you'll have to compile ALVAR from the "src" package, while configuring it to create one. \$\endgroup\$ – Quentin Aug 25 '16 at 9:10

You should be a little bit more versatile, you should search resources from other people, maybe by using this it's a good start:


It says Unity 3.5.5 Pro, don't worry about this, because Unity 5 has all Plugins features from Pro lower versions.

And the Unity Import Script API should translate it to the newest code! Maybe you will see some compiler warnings.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.