简体   繁体   中英

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

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

The OPENCV_DIR is set to Z:\\Documents\\Work\\opencv\\build\\x64\\vc12 ,
the Target Machine in Configuration Properties -> Linker -> Advanced is set to /MACHINE:x64.
When I click Run, I get an error: fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

When the OPENCV_DIR is set to Z:\\Documents\\Work\\opencv\\build\\x86\\vc12 ,
and The Target Machine is set to /MACHINE:x86 ,
I get an error: fatal error LNK1112: module machine type 'X64' conflicts with target machine type 'x86'

This seems impossible to me. Help =C

The normal place for specifying the target machine is just what you changed: Linker -> Advanced -> Target Machine . But OpenCV comes with a little extra gotcha. In Linker -> All Options -> Additional Options , it specifies /machine:X86 . When you create a new x64 Platform target from the Win32 Platform, that little bit of configuration comes along for the ride.

So, for your x64 targets, go into Linker -> All Options -> Additional Options and remove /machine:X86 . Then, the configuration will come from Linker -> Advanced -> Target Machine , just as you'd expect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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