1

I am using visual studio 2012.i got the error

LNK1112: module machine type 'x64' conflicts with target machine type
'X86'highgui248d.lib(opencv_highgui248d.dll)' while building a win32 
console application.

I have tried modifying the property to match with my open_cv application requirement.

Trevor Hickey
  • 36,288
  • 32
  • 162
  • 271
Prasrit Kumar
  • 11
  • 1
  • 1
  • 2
  • You are running a 64 bit setup in 32 bit os – amar Sep 19 '14 at 14:53
  • Try changing Project -> Properties -> Platform – Dan Sep 19 '14 at 16:43
  • 1
    possible duplicate of [fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'](http://stackoverflow.com/questions/3563756/fatal-error-lnk1112-module-machine-type-x64-conflicts-with-target-machine-typ) – Sndn Mar 15 '15 at 15:36

2 Answers2

1

Here's the answer for your issue. Probably you need to change the platform in Build configuration manager https://stackoverflow.com/a/4364020/3724463

Community
  • 1
  • 1
Sndn
  • 980
  • 12
  • 20
0

I found the solution to this annoying problem, just follow steps below:

  1. In your Project Properties -> VC++ Directories -> Library Directories check that you have included only x64 build path if not please remove the x86 build path (something like this: C:\opencv2413\build\x64\vc12\lib) make changes according to extraction path of OpenCV in your system.

  2. In your Project Properties -> Linker -> General -> Additional Library Directories check that it is set to x64 and not x86 like this ($(OPENCV_BUILD)\x64\vc12\lib).

  3. If you have added a property sheet apply above steps to same.

  4. Delete Release|Win32 and Debug|Win32 (or Release|X86 and Debug|X86) in property Manager.

  5. Build your project using Release or Debug x64.

If this doesn't work please let me know, I would be glad to help.

FutureJJ
  • 2,368
  • 1
  • 19
  • 30