OptiTrack Camera SDK 1.7.5 and Unity3D 5 dllnotfound

Post Reply
NightRabbit
Posts: 2
Joined: Thu Apr 02, 2015 1:14 am

OptiTrack Camera SDK 1.7.5 and Unity3D 5 dllnotfound

Post by NightRabbit »

Hello, this is my first post. So I apologize in advance for any stupid question I might make. ^^

I have been compiling camera sdk dll and run it in Unity3D 5.1 (32-bit),
on Window 7 64-bit. but all I got was dllnotfound exception.

I have been trying to fix this for the pass week. Here is what I have done. Please help me T_T
- Include folder and lib folder in VS2013 project property.
- Setup preprocessor definition: CAMERALIBRARY_IMPORTS;CORE_IMPORTS;
- Use runtime library: Multi-threaded Debug (/MTd)
- Add additional dependencies: CameraLibrary2010S.lib
- Setup environment for library DLL reference: PATH=%PATH%;$(NP_CAMERASDK)\lib

Since I am running on 64-bit window 7, but working on 32-bit Unity3D. Is it correct that I use CameraLibrary2010S.lib? or should I go with CameraLibrary2010x64S.lib. FYI sample application run fine with 32 bit library but x64 version won't compile (LNK2019).

I have tested the DLL project. Unity found DLL and operate normally when there is no call to camera sdk.

Thank you in advance for your help :)
PS. unity plugin sample that came with the SDK uses "cameralibrary.lib" which I assume doesn't exist any more. Is that correct? Or I need to use "cameralibrary.lib" instead of CameraLibrary2010S.lib, but I found no where to get it though.
steven.andrews
NaturalPoint Employee
NaturalPoint Employee
Posts: 720
Joined: Mon Jan 19, 2015 11:52 am

Re: OptiTrack Camera SDK 1.7.5 and Unity3D 5 dllnotfound

Post by steven.andrews »

Hello NightRabbit,

Welcome to the forum. Here are some thoughts our engineers had after looking through your questions.

1. By choosing the project setting: Multi-threaded Debug (/MTd) you need to link against CameraLibrary2010D.lib for 32bit targets and CameraLibrary2010x64D.lib for 64-bit projects.

2. Your assumption is correct that cameralibrary.lib doesn't exist anymore and instead link against what is described in #1.

3. Since you're running 32-bit Unity, we would just stay in 32-bit land across the board. Compile your Unity DLL as a 32-bit target and link against the 32-bit Camera SDK lib/dll (described in #1).

4. In our testing the DLL based approach, used in this sample, Unity was a bit unstable. We're not sure this DLL approach works well when there is hardware involved.
We use a different approach in our NatNet SDK (Unity Sample) that streams data over UDP which has proven to be a very accessible way to stream into Unity that works well with Unity's workflow of switching between run & develop constantly and does not require a Unity Pro license.
http://optitrack.com/products/natnet-sdk/

I hope this helps get you up and running. If you need further assistance, we're happy to help.

Cheers,
Steven
--
Steven Andrews
OptiTrack | Customer Support Engineer
NightRabbit
Posts: 2
Joined: Thu Apr 02, 2015 1:14 am

Re: OptiTrack Camera SDK 1.7.5 and Unity3D 5 dllnotfound

Post by NightRabbit »

Thank you Steven for the tip

After almost 10 days. I finally get it to run. Phew.
So I change the library to CameraLibrary2010D.lib
But that alone doesn't work. The plugin is use in Unity 5 project.
It will look for CameraLibrary2010D.lib and CameraLibrary2010D.dll in project folder.
Even though environment has been specified when compile.

Here is my complete setup
- Runs on window 7 64 bit, Unity 5 (32 bit) 3.0.1f1
- Include folder and lib folder in VS2013 project property.
- Setup preprocessor definition: CAMERALIBRARY_IMPORTS;CORE_IMPORTS;
- Use runtime library: Multi-threaded Debug (/MTd)
- Add additional dependencies: CameraLibrary2010D.lib
- Setup environment for library DLL reference: PATH=%PATH%;$(NP_CAMERASDK)\lib
- Place CameraLibrary2010D.lib and CameraLibrary2010D.dll at <unity_project_folder>/
- Place your plugin at <unity_project_folder>/Assets/Plugins
Post Reply