OpenNI on a 64-bit windows

928 views
Skip to first unread message

WengYi

unread,
Jul 23, 2011, 8:54:34 AM7/23/11
to OpenNI
I have installed the driver and etc and NIviewer works for me.

However, when I try to write my own code (eg. saving it into an
image),

I run into this error:
1>------ Build started: Project: calib, Configuration: Debug Win32
------
1>Compiling...
1>Calib.cpp
1>Calib_my.cpp
1>c:\opencv2.1\include\opencv\cvcompat.h(803) : warning C4819: The
file contains a character that cannot be represented in the current
code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\openni\include\win32\xnoswin32.h(42) : warning
C4005: '_CRT_SECURE_NO_DEPRECATE' : macro redefinition
1> c:\opencv2.1\include\opencv\cxtypes.h(47) : see previous
definition of '_CRT_SECURE_NO_DEPRECATE'
1>c:\users\weng yi\downloads\calib_my.cpp(14) : warning C4101:
'pPixel' : unreferenced local variable
1>Generating Code...
1>Linking...
1>Calib_my.obj : error LNK2019: unresolved external symbol
__imp__xnOSMemSet referenced in function "public: __thiscall
xn::ImageMetaData::ImageMetaData(void)" (??0ImageMetaData@xn@@QAE@XZ)
1>Calib_my.obj : error LNK2019: unresolved external symbol
__imp__xnOSFreeAligned referenced in function "public: void __thiscall
xn::OutputMetaData::Free(void)" (?Free@OutputMetaData@xn@@QAEXXZ)
1>Calib_my.obj : error LNK2019: unresolved external symbol
__imp__xnContextRegisterForShutdown referenced in function "public:
void __thiscall xn::NodeWrapper::SetHandle(struct XnInternalNodeData
*)" (?SetHandle@NodeWrapper@xn@@QAEXPAUXnInternalNodeData@@@Z)
1>Calib_my.obj : error LNK2019: unresolved external symbol
__imp__xnProductionNodeAddRef referenced in function "public: void
__thiscall xn::NodeWrapper::SetHandle(struct XnInternalNodeData *)" (?
SetHandle@NodeWrapper@xn@@QAEXPAUXnInternalNodeData@@@Z)
1>Calib_my.obj : error LNK2019: unresolved external symbol
__imp__xnProductionNodeRelease referenced in function "public: void
__thiscall xn::NodeWrapper::SetHandle(struct XnInternalNodeData *)" (?
SetHandle@NodeWrapper@xn@@QAEXPAUXnInternalNodeData@@@Z)
1>Calib_my.obj : error LNK2019: unresolved external symbol
__imp__xnContextRelease referenced in function "public: void
__thiscall xn::NodeWrapper::SetHandle(struct XnInternalNodeData *)" (?
SetHandle@NodeWrapper@xn@@QAEXPAUXnInternalNodeData@@@Z)
1>Calib_my.obj : error LNK2019: unresolved external symbol
__imp__xnContextUnregisterFromShutdown referenced in function "public:
void __thiscall xn::NodeWrapper::SetHandle(struct XnInternalNodeData
*)" (?SetHandle@NodeWrapper@xn@@QAEXPAUXnInternalNodeData@@@Z)
1>Calib_my.obj : error LNK2019: unresolved external symbol
__imp__xnGetRefContextFromNodeHandle referenced in function "public:
void __thiscall xn::NodeWrapper::SetHandle(struct XnInternalNodeData
*)" (?SetHandle@NodeWrapper@xn@@QAEXPAUXnInternalNodeData@@@Z)
1>Calib_my.obj : error LNK2019: unresolved external symbol
__imp__xnGetImageMetaData referenced in function "public: void
__thiscall xn::ImageGenerator::GetMetaData(class xn::ImageMetaData
&)const " (?GetMetaData@ImageGenerator@xn@@QBEXAAVImageMetaData@2@@Z)
1>Calib_my.obj : error LNK2019: unresolved external symbol
__imp__xnSetPixelFormat referenced in function "public: unsigned int
__thiscall xn::ImageGenerator::SetPixelFormat(enum XnPixelFormat)" (?
SetPixelFormat@ImageGenerator@xn@@QAEIW4XnPixelFormat@@@Z)
1>C:\Users\Weng Yi\Documents\Visual Studio 2008\Projects\calib\Debug
\calib.exe : fatal error LNK1120: 10 unresolved externals
1>Build log was saved at "file://c:\Users\Weng Yi\Documents\Visual
Studio 2008\Projects\calib\calib\Debug\BuildLog.htm"
1>calib - 11 error(s), 3 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==========

This was what I did:

In the C/C++ section, under the General node, find the "Additional
Include Directories" and add "$(OPEN_NI_INCLUDE)".
In the Linker section, under the General node, find the "Additional
Library Directories" and add "$(OPEN_NI_LIB64)".
In the Linker section, under the Input node, find the "Additional
Dependencies" and add OpenNI64.lib

What went wrong?

Thank you and greatly appeaciate if anyone knows the solution to
this :)

Yuri Fedotov

unread,
Jul 31, 2011, 8:48:10 AM7/31/11
to OpenNI
Hi Weng,

You are building your project for Win32 platform; try switching to x64
target - in my case this resolved a similar problem.

Regards,
Yuri.
Reply all
Reply to author
Forward
0 new messages