2

Recently I worked on a facial recognition application in Visual Stuido 2015. In order to apply cuda libraries to the app, this app needs to migrate from win32 type to x64. I carefully change the configuration manager and moderate everything involved with x86 when making sure every extern dll or lib has its x64 version.

But after compiled in release mode, there is always a error message: "LNK1112 module computer type 'x86' conflicts target computer type 'x64'". The error file is CameraDS.obj which is written by directshow. And I checked the producing .obj files with dumpbin /headers, then discovered the header file values of every .obj is machine (x86). Delete these .obj files or just clean solution doesn't work, and the IDE just throws the same error message. I don't konw why.

Is there any solution?

Desperate VS
  • 61
  • 1
  • 7
  • 2
    What do you mean by "CameraDS.obj is written by directshow"? If it is an external obj then maybe you need to link 64-bit version of it? – user7860670 Dec 06 '17 at 08:21
  • I mean the CameraDS class is written by directshow, when compiling that CameraDS.obj exists. – Desperate VS Dec 07 '17 at 08:10

1 Answers1

1

Is it the source of the lib CameraDS.obj? https://github.com/souseiki/Stereo-Vision

Just recompile it for x64 as well.

Also check that you haven't left x86 anywhere, look at the answers of fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

Anton Malyshev
  • 8,686
  • 2
  • 27
  • 45
  • Yes, it is. But I found not only CameraDS class produced x86 .obj, any other class has the same change even if I clean these .obj files. Before asking I have checked possible fault one by one in that question. I rebuild a x64 project and copy all codes and problem solved, but I still want to know why. – Desperate VS Dec 07 '17 at 08:13
  • If you still have the project file with error you can open .vcxproj file as text and look for x64 inside, it must be some setting somewhere. – Anton Malyshev Dec 07 '17 at 09:27
  • You mean .vcxproj file under the file named after project's? Is it shared by both x86 and x64 version? I open that and find many content with win32 and x64. And I try to migrate x64 to x86 in my new project, there're much more error message when compiler produces .obj files... – Desperate VS Dec 07 '17 at 13:29
  • Yes, this file. It contains settings for both win32 and x64, so you need to check only x64 and common sections. – Anton Malyshev Dec 07 '17 at 15:07
  • I found a line in containing these $(VCInstallDir)bin;$(VCInstallDir)\bin\x86_amd64;$(WindowsSdkDir)bin\NETFX 4.0 Tools;$(WindowsSdkDir)bin;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)\bin;$(MSBuildToolsPath32);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);$(ExecutablePath) Does that influence? Well, I compare original file with my new project and something is different but they dont contain win32 or x86. – Desperate VS Dec 08 '17 at 08:24