OpenNI 2 and Visual Studio 2012

后端 未结 3 520
死守一世寂寞
死守一世寂寞 2020-12-16 02:44

I just downloaded OpenNI 2 SDK (www.openni.org) and I am trying to setup a project in Visual Studio 2012. What I did:

  1. Create a new C++ Win32 Console Applicatio
相关标签:
3条回答
  • 2020-12-16 03:10

    If you add all of options (Include, Lib, ...) to your project setting and again get this error, maybe your project platform is Win32 and you want to use OpenNI x64

    In this case, you must change the platform to x64 (Project properties at the top of the page)

    • If you don't have x64 option, make a new one ;)
    0 讨论(0)
  • 2020-12-16 03:27

    you also need to point to the actual library file: openni2.lib

    0 讨论(0)
  • 2020-12-16 03:33

    Also you should do the below steps:

    0-In the C/C++ section, under the "General" node, select

    "Additional Include Directories" 
    

    and add

    "$(OPENNI2_INCLUDE)" (if you use the 32-bit version) or 
    "$(OPENNI2_INCLUDE64)" (if you use the 64-bit version). 
    

    These are environment variables that point to the location of the OpenNI Include directory. (The defaults are :

    C:\Program Files\OpenNI2\Include or 
    C:\Program Files (x86)\OpenNI2\Include)
    

    1-In the Linker section, under the "General" node, select

    "Additional Library Directories" 
    

    and add

    "$(OPENNI2_LIB)" (if you use the 32-bit version) or 
    "$(OPENNI2_LIB64)" (if you use the 64-bit version). 
    

    These are environment variables that point to the location of the OpenNI Lib directory. (The defaults are:

    C:\Program Files\OpenNI2\Lib or 
    C:\Program Files (x86)\OpenNI2\Lib)
    

    2-In the Linker section, under the input node, select

    "Additional Dependencies" 
    

    and add

    OpenNI2.lib or OpenNI2.lib
    

    3-Ensure that you add the Additional Include and Library directories to both your Release and Debug configurations.

    4-Copy all the files from OpenNI's redist directory (see environment variable "$(OPENNI2_REDIST)" or "$(OPENNI2_REDIST64)") to your working directory. (The defaults are

    C:\Program Files\OpenNI2\Redist or 
    C:\Program Files (x86)\OpenNI2\Redist). 
    

    Be aware that when you run from command line, the working directory is the directory where the executable can be found, and where you run from Visual Studio the default directory is where the project file (.vcproj, .vcxproj) can be found.

    0 讨论(0)
提交回复
热议问题