Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top