简体   繁体   English

OpenCV + VS2013 + Windows 8.1 x64

[英]OpenCV + VS2013 + Windows 8.1 x64

I have fully followed this tutorial(Installation by using pre-build libraries): http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html 我已经完全遵循了本教程(使用预构建库进行安装): http : //docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html

After that I have completed all the steps of this tutorial(The local method): http://docs.opencv.org/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html 之后,我完成了本教程的所有步骤(本地方法): http : //docs.opencv.org/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html

The OPENCV_DIR is set to Z:\\Documents\\Work\\opencv\\build\\x64\\vc12 , OPENCV_DIR设置为Z:\\ Documents \\ Work \\ opencv \\ build \\ x64 \\ vc12
the Target Machine in Configuration Properties -> Linker -> Advanced is set to /MACHINE:x64. 在配置属性->链接器->高级中将目标计算机设置为/ MACHINE:x64。
When I click Run, I get an error: fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64' 当我单击运行时,出现错误: 致命错误LNK1112:模块机器类型'X86'与目标机器类型'x64'冲突

When the OPENCV_DIR is set to Z:\\Documents\\Work\\opencv\\build\\x86\\vc12 , OPENCV_DIR设置为Z:\\ Documents \\ Work \\ opencv \\ build \\ x86 \\ vc12时
and The Target Machine is set to /MACHINE:x86 , 并且“ 目标机器”设置为/ MACHINE:x86
I get an error: fatal error LNK1112: module machine type 'X64' conflicts with target machine type 'x86' 我收到一个错误: 致命错误LNK1112:模块机器类型'X64'与目标机器类型'x86'发生冲突

This seems impossible to me. 对我来说这似乎是不可能的。 Help =C 帮助= C

The normal place for specifying the target machine is just what you changed: Linker -> Advanced -> Target Machine . 指定目标机器的通常位置就是您所做的更改: Linker-> Advanced-> Target Machine But OpenCV comes with a little extra gotcha. 但是OpenCV带有一些额外的陷阱。 In Linker -> All Options -> Additional Options , it specifies /machine:X86 . 链接器->所有选项->附加选项中 ,它指定/ machine:X86 When you create a new x64 Platform target from the Win32 Platform, that little bit of configuration comes along for the ride. 从Win32平台创建新的x64平台目标时,需要进行一些配置。

So, for your x64 targets, go into Linker -> All Options -> Additional Options and remove /machine:X86 . 因此,对于x64目标,请进入Linker-> All Options-> Additional Options并删除/ machine:X86 Then, the configuration will come from Linker -> Advanced -> Target Machine , just as you'd expect. 然后,配置将如您期望的那样从Linker-> Advanced-> Target Machine进行

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

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