Question

I am trying to get my plugin for Unity Xbox to work correctly. For those who are not familiar with this process, all that is required is a .cpp file and the libraries and headers to be defined in the VC++ Directories options. However, I keep getting this error whenever I go to build:

error LNK2019: unresolved external symbol "struct _XMMATRIX __cdecl NuiTransformMatrixLevel(struct __vector4)" (?NuiTransformMatrixLevel@@YA?AU_XMMATRIX@@U__vector4@@@Z) referenced in function GetPlaySpaceFrustum    DLLProject.obj  DLLProject

The function in question is being called via nuiapi.h which i have included in the .cpp file. My understanding is that this error typically occurs when a library is not linked but since all of the libraries for xbox are linked in the VC++ Directories in the options menu, I thought that I would not get this error. Is there another reason I should get this error?

Partial Code Sample:

#ifdef _XBOX
     #include <xtl.h>
     #include <nuiapi.h>
#else
    #define WIN32_LEAN_AND_MEAN
    #include <windows.h>
#endif
#include <stdio.h>

extern "C" __declspec(dllexport)
void TestFunction(float GravX, float GravY, float GravZ, float GravW) {
     XMVECTOR NormalToGravity = {GravX, GravY, GravZ, GravW};
     XMMATRIX MatLevel = NuiTransformMatrixLevel(NormalToGravity);

}

Était-ce utile?

La solution

The issue is resolved now. Had to link the library in question under where the development environment is set for Unity(via code), as well as add the library to the Linker's Additional Dependencies.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top