我想在Visual Studio 2012中使用OpenNI構建一個.cpp文件。我使用SimpleViewer樣本(它包含在OpenNI中)的代碼。當我嘗試構建.cpp文件時,得到了編譯器必須鏈接OpenNI庫時出現的錯誤LNK2019,這似乎是一個問題。什麼可能是錯的?錯誤LINK2019使用OpenNI和Visual Studio
錯誤(總共55):
> Error 1 error LNK2019: unresolved external symbol __imp__oniShutdown
> referenced in function "public: static void __cdecl
> openni::OpenNI::shutdown(void)"
> ([email protected]@[email protected]@SAXXZ) C:\Develop\VisualStudioWorkspace\Projects\My
> programs\OpenNI2_test\OpenNI2_test\Viewer.obj OpenNI2_test
Error 2 error LNK2019: unresolved external symbol __imp__oniWaitForAnyStream referenced in function "public: static enum openni::Status __cdecl openni::OpenNI::waitForAnyStream(class openni::VideoStream * *,int,int *,int)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]) C:\Develop\VisualStudioWorkspace\Projects\My programs\OpenNI2_test\OpenNI2_test\Viewer.obj OpenNI2_test
我跟着OpenNI website描述編譯在Visual Studio中的文件的所有步驟:我添加了所有的VCC目錄和include和lib環境變量。我還在鏈接器部分的附加依賴項中添加了OpenNI2.lib。我還在工作目錄(我有.vcproj的目錄)中複製了Redist文件。
有解決方案,請檢查這個[問題] [1] 也許它適用於您的情況! [1]:http://stackoverflow.com/questions/14644191/openni-2-and-visual-studio-2012/15078460#15078460 – NKN 2013-08-08 10:31:14