Problem with calling from Unity

Post Reply
cybie
Posts: 3
Joined: Mon Sep 12, 2011 4:11 pm

Problem with calling from Unity

Post by cybie »

I am trying to call Camera SDK from Unity.

However, when I called a DLL function it die trying to create the single CameraManager::X()

In singleton.h

Code: Select all

        static T& X()
        {
            if (m_instance == 0) 
            {
                if(m_Lock==0)
                    m_Lock = new LockItem();

                m_Lock->Lock();
                if(m_instance==0)
                {
                    m_instance = new T; // << Die here
                }
                m_Lock->UnLock();
            }

            return *m_instance;
        };
The "new T" was successful in allocating memory, but failed to continue to go to next line. So I suspect it might be dying in the constructor.

Any Ideas?

Thanks
David
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: Problem with calling from Unity

Post by beckdo »

I'm not entirely sure what the issue is here but would love to know the answer.

For the Camera SDK the run-time is statically linked. Perhaps that is the problem. If anyone has any additional insight, I would like to track this down so that our Camera SDK will place nice with Unity.
cybie
Posts: 3
Joined: Mon Sep 12, 2011 4:11 pm

Re: Problem with calling from Unity

Post by cybie »

Hi Doug,

I am not sure if that is the problem, but is it possible for you to release the Camera SDK as dynamically linked DLL?

Thanks
David
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: Problem with calling from Unity

Post by beckdo »

Email support and I'll have them send you a dynamically linked DLL, hopefully that will solve the problem. I will likely add this build to the installer so it's available to everyone.
cybie
Posts: 3
Joined: Mon Sep 12, 2011 4:11 pm

Re: Problem with calling from Unity

Post by cybie »

Hi Doug,

I have contacted the support through the support contact form. I am still waiting for the library.

Thanks
David
NaturalPoint - Mike
Posts: 1896
Joined: Tue Feb 01, 2011 8:41 am
Location: Corvallis, OR

Re: Problem with calling from Unity

Post by NaturalPoint - Mike »

A link to the library should be in your mail.
sebh
Posts: 1
Joined: Fri Oct 21, 2011 1:35 am

Re: Problem with calling from Unity

Post by sebh »

Hello! I have the same problem here!

I have created a dll I want to call from another program but it dies at singleton creation.
The weird thing is that it works sometimes if I put a printf instruction before creating the singleton. Unfortunately, this is not an acceptable solution.

Have you found any solution? Can I also have an access to that dll please?
Post Reply