Home › Forums › Legacy SDKs › Unity: DllNotFoundException: TobiiGazeCore64.dll
Tagged: dll, NotFound error, Unity
- This topic has 6 replies, 5 voices, and was last updated 8 years, 3 months ago by Alex [Tobii].
- AuthorPosts
- 03/02/2015 at 07:59 #2463Dieter MerkelParticipant
Hi,
i am trying to build a program with Unity and GazeSDK.
I downloaded the Gaze SDK for .NET and copied the 64bit dlls into my unity-project root folder. But when i try to run the program in the editor i get the error:
DllNotFoundException: TobiiGazeCore64.dll Tobii.Gaze.Core.EyeTrackerCoreLibrary.GetConnectedEyeTracker () TobiiData.Start () (at Assets/Tobii/TobiiData.cs:13)
Here is the Code:
using UnityEngine; using System; using System.Threading; using System.Collections; using Tobii.Gaze.Core; public class TobiiData : MonoBehaviour { private IEyeTracker tracker; private Thread thread; private static GazeData lastGazeData; void Start () { Uri url = new EyeTrackerCoreLibrary().GetConnectedEyeTracker(); tracker = new EyeTracker (url); tracker.EyeTrackerError += EyeTrackerError; tracker.GazeData += EyeTrackerGazeData; thread = CreateAndRunEventLoopThread(tracker); tracker.Connect(); tracker.StartTracking(); #if UNITY_EDITOR UnityEditor.EditorApplication.playmodeStateChanged = closeDLL; #endif } #if UNITY_EDITOR void closeDLL(){ if ( !(UnityEditor.EditorApplication.isPlaying) && !(UnityEditor.EditorApplication.isPaused)){ tracker.StopTracking(); tracker.Disconnect(); if (thread != null) { tracker.BreakEventLoop(); thread.Join(); } } } #endif /*************************************************************** * tobii functions to use the eye tracker via the eye gaze sdk * * *************************************************************/ private static string CoreLibraryVersion() { using (var lib = new EyeTrackerCoreLibrary()) { return lib.LibraryVersion(); } } private static Thread CreateAndRunEventLoopThread(IEyeTracker tracker) { var thread = new Thread(() => { try { tracker.RunEventLoop(); } catch (EyeTrackerException ex) { print("An error occurred in the eye tracker event loop: " + ex.Message); } print("Leaving the event loop."); }); thread.Start(); return thread; } private static void PrintDeviceInfo(IEyeTracker tracker) { var info = tracker.GetDeviceInfo(); print(string.Format ("Serial number: {0}", info.SerialNumber)); var trackBox = tracker.GetTrackBox(); print(string.Format ("Track box front upper left ({0}, {1}, {2})", trackBox.FrontUpperLeftPoint.X, trackBox.FrontUpperLeftPoint.Y, trackBox.FrontUpperLeftPoint.Z)); } private static void EyeTrackerGazeData(object sender, GazeDataEventArgs e) { lastGazeData = e.GazeData; } private static void EyeTrackerError(object sender, EyeTrackerErrorEventArgs e) { print("ERROR: " + e.Message); } }
The error line is:
Uri url = new EyeTrackerCoreLibrary().GetConnectedEyeTracker();
in the Start function.Anyone know what i am doing wrong ?
Regards
03/02/2015 at 08:48 #2464Dieter MerkelParticipantSolved:
Do not know why, but it seems that Unity has some problems with the 64 bit version (or i forgot to set some settings ? anyway ).
If someone has the same problems:
– use the 32 bit dlls
– copy TobiiGazeCore32.dll into the project root folder
– copy Tobii.Gaze.Core.Net.dll into assets/plugins folderThat worked for me.
Edit: Oh and make sure there are no _just_in_case_ dlls of 64 version in your project.
03/02/2015 at 09:03 #2465AndersParticipantHi Dieter,
great to hear that you could sort it out and thanks for the advice.12/01/2016 at 03:42 #4050AhmadParticipantI did all of those steps, still get the dll exception.
20/01/2016 at 16:03 #4157Grant [Tobii]KeymasterHi Ahmad,
We generally recommend that if you are intending to work with the Unity engine that you use
the EyeX SDK.Unless you have reason to use the GazeSDK, I would encourage you to try instead with the EyeX SDK
and let us know if your issues persist.31/05/2016 at 15:10 #5268AhmadParticipantI want to find the distance from the player eyes to the screen. GazeSdk can give such info for me only.
21/07/2016 at 14:24 #5438Alex [Tobii]ParticipantHi!
Check EyePositionDataStream from EyeX SDK for .NET (not the one for Unity)
It provides a stream of eye position data, that is, eye positions in 3D space. - AuthorPosts
- You must be logged in to reply to this topic.