-1

I'm converting my x86 MFC dll code to x64 on Visual Studio 2015 and I'm getting the error message:

.\Debug\FabricaPesquisa.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

I already checked the Target Machine on Linker and it is correct (MachineX64 (/MACHINE:X64)), my "Additional Options" is blank (apparently wrong information here can cause the same error), the Configuration Manager it is referencing the correct platform, the libs added on "Additional Dependencies" are all x64 ( I also tried removing them and it didn't change the error).

When I used dumpbin in my .obj files (as suggested in this answer) I noticed that all of them are machine (x86).

I also followed the steps on this answer, making sure that the paths in "Executable Directories" are referencing x64 directories:

$(VSInstallDir)

$(VSInstallDir)bin

$(VSInstallDir)bin\x86_amd64

$(WindowsSDK_ExecutablePath_x64)

How can I solve this problem?

Thanks in advance and any hint will be appreciated!

Community
  • 1
  • 1
Penachia
  • 389
  • 4
  • 18

1 Answers1

0

In case anyone goes through the same problem, apparently, I didn't pay enough attention to this answer and didn't realize that the order of the entries matters,

to work it's necessary to put $(VCInstallDir)\bin\x86_amd64 before of $(VCInstallDir)\bin in the Project Properties > VC++ Directories > Executable Directories.

Penachia
  • 389
  • 4
  • 18