This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

How can I resolve this link error LNK1112 when building on 64-bit Windows?

0

I followed the steps mentioned in the wiki article for win64 compilation, but I am getting the below error:

ERROR
fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

Below is the compilation log:

D:\wireshark-1.6.7>nmake -f Makefile.nmake all

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 Copyright (C) Microsoft Corporation. All rights reserved.

    cd tools
    "D:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" /
              -f Makefile.nmake

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 Copyright (C) Microsoft Corporation. All rights reserved.

    cd lemon
    ..\native-nmake "D:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\B

IN\nmake.exe" / -f Makefile.nmake Setting environment for using Microsoft Visual Studio 2008 x86 tools.

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 Copyright (C) Microsoft Corporation. All rights reserved.

    cd ..
    cd ..
    cd image
    "D:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" /
              -f Makefile.nmake

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 Copyright (C) Microsoft Corporation. All rights reserved.

    cd ..
    cd codecs
    "D:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" /
              -f Makefile.nmake

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 Copyright (C) Microsoft Corporation. All rights reserved.

'codecs.lib' is up-to-date cd .. xcopy D:\wireshark-win64-libs-1.6\zlib125 zlib.tmp /D /I /E /Y 0 File(s) copied cd zlib.tmp "D:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" / -f win32/Makefile.msc zlib1.dll AS=ml64 LOC="-DASMV -DASMINF" OBJA="inffasx64.obj gvmat64.obj inffas8664.obj"

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 Copyright (C) Microsoft Corporation. All rights reserved.

    link -nologo -debug -incremental:no -opt:ref -def:win32/zlib.def -dll -i

mplib:zdll.lib -out:zlib1.dll -base:0x5A4C0000 adler32.obj compress.obj crc32.o bj deflate.obj gzclose.obj gzlib.obj gzread.obj gzwrite.obj infback.obj inflate .obj inftrees.obj trees.obj uncompr.obj zutil.obj inffasx64.obj gvmat64.obj inff as8664.obj zlib1.res inffasx64.obj : fatal error LNK1112: module machine type 'x64' conflicts with ta rget machine type 'X86' NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio 9.0
VC\BIN\x86_amd64\link.EXE"' : return code '0x458' Stop. NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio 9.0
VC\BIN\nmake.exe"' : return code '0x2' Stop.

D:\wireshark-1.6.7>

asked 26 Apr ‘12, 09:09

Pradeep's gravatar image

Pradeep
1111
accept rate: 0%

edited 26 Apr ‘12, 09:31

multipleinterfaces's gravatar image

multipleinte…
1.3k152340


2 Answers:

1

I think the issue is more likely to be confusion over the build type and artefacts left from a previous build attempt. If you switch from x86 to x64 or vice-versa with an in-tree (i.e. nmake) build then you must run nmake -f Makefile.nmake distclean and then to make sure del /s *.obj and del /s *.lib to clean up.

Then you must also start a new command prompt and set the required VC tool chain (i.e. appropriate vcvars.bat for x86 or x64) and ensure any changes to config.nmake are also modified correctly for the required build type.

For the OP's question, they are using the x86 toolchain

Setting environment for using Microsoft Visual Studio 2008 x86 tools.

but using 64 bit libraries;

xcopy D:\wireshark-win64-libs-1.6\zlib125

answered 28 Jan '15, 02:36

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

edited 28 Jan '15, 02:37

if target machine is x86 why is it using wireshark-win64-libs... Is it because he didnot use nmake -f Makefile.nmake setup command before making all but only changed the target machine type to win32???

(29 Jan '15, 01:04) koundi

0

I know its late but for someone else who encounters the same problem this might help!!

So..This is because you are using x64 native command prompt and trying to build 32 bit version of wireshark.Make sure you use the correct command prompt!!

answered 27 Jan '15, 23:32

koundi's gravatar image

koundi
9791119
accept rate: 0%