简体   繁体   English

OpenCV 2.4.8。 从源安装不包含\\ Build \\ x64 \\ vc10

[英]OpenCV 2.4.8. Installation from source does not contain \Build\x64\vc10

I'm running into trouble when trying to use OpenCV 2.4.8 in Visual Studio 2010. I've built OpenCV from source since i'll be needing CUDA functionality. 在Visual Studio 2010中尝试使用OpenCV 2.4.8时遇到麻烦。由于需要CUDA功能,因此已从源代码构建了OpenCV。

When arriving at the step to add the path to the environment variable as indicated here: http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html#windowssetpathandenviromentvariable , it seems \\Build\\x64\\vc10 is not present in my OpenCV folder. 当到达将路径添加到环境变量的步骤时,如下所示: http : //docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html#windowssetpathandenviromentvariable ,看来\\ Build \\ x64 \\ vc10是在我的OpenCV文件夹中不存在。 Instead, I've simply added C:\\OpenCV\\build as OPENCV_DIR to my environment path, since it seems lib and bin are present in this folder. 相反,我只是将C:\\ OpenCV \\ build作为OPENCV_DIR添加到我的环境路径中,因为似乎lib和bin存在于此文件夹中。

However, adding $(OPENCV_DIR)....\\include to my Visual Studio 2010 project, as indicated here: http://docs.opencv.org/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html#windows-visual-studio-how-to will yield unwanted results, as this will point to my C:\\ drive, instead of the OpenCV root folder. 但是,将$(OPENCV_DIR).... \\ include添加到我的Visual Studio 2010项目中,如下所示: http ://docs.opencv.org/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html#windows-visual- studio-how-to将产生不需要的结果,因为这将指向我的C:\\驱动器,而不是OpenCV根文件夹。 My OpenCV root folder does have an include folder, however it does not seem to contain relevant files (some files related to CMake). 我的OpenCV根文件夹确实包含一个include文件夹,但是它似乎不包含相关文件(某些与CMake相关的文件)。

Long story short, it seems I'm unable to add OpenCV to Visual Studio 2010 if OpenCV is built from source. 长话短说,如果OpenCV是从源代码构建的,则似乎无法将OpenCV添加到Visual Studio 2010。

Can anybody see what I'm missing here? 有人可以看到我在这里想念的吗?

Any help is greatly appreciated. 任何帮助是极大的赞赏。

The instructions assume you are using the prebuilt binaries that come with OpenCV. 这些说明假定您使用的是OpenCV随附的预构建二进制文件。 If you build it yourself (as in your case), you have two options: 如果您自己构建(如您的情况),则有两个选择:

  1. Set CMAKE_INSTALL_PREFIX when building opencv and run the INSTALL target to put all of the OpenCV files you need in known place that works for you. 在构建opencv时设置CMAKE_INSTALL_PREFIX并运行INSTALL目标以将所需的所有OpenCV文件放置在适合您的已知位置。 Set OPENCV_DIR to this installed location (ie C:\\libs\\opencv), and set the include directory to $(OPENCV_DIR)\\include . 将OPENCV_DIR设置到此安装位置(即C:\\ libs \\ opencv),并将include目录设置为$(OPENCV_DIR)\\include
  2. set OPENCV_DIR to the build directory (as you've done), but when setting the include directory only go up one directory: $(OPENCV_DIR)..\\include ; 将OPENCV_DIR设置到构建目录(已完成),但是在设置包含目录时,仅进入一个目录: $(OPENCV_DIR)..\\include ; this will point to the include directory in the original source location 这将指向原始源位置中的include目录

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM