Fatal error LNK1112: module type of module "X86" conflicts with type of target machine "AMD64"

I am using VS 2003.Net on a 32-bit XP OS. I also installed the "Microsoft Platform SDK" on my machine. Can I create a vC ++ application (binaries) for a 64-bit OS?

I use the following project options:

    Name="VCLinkerTool"
    AdditionalOptions="/machine:AMD64 bufferoverflowU.lib"
    OutputFile="\bin\Release\MM64.dll"
    LinkIncremental="1"
    SuppressStartupBanner="TRUE"
    AdditionalLibraryDirectories=""C:\Program Files\Microsoft Platform SDK\Lib\AMD64""
    GenerateDebugInformation="TRUE"
    ProgramDatabaseFile="\bin\Release\MM64.pdb"
    GenerateMapFile="TRUE"
    MapFileName="\bin\Release\MM64.map"
    MapExports="TRUE"
    MapLines="TRUE"
    OptimizeReferences="2"
    EnableCOMDATFolding="2"
    ImportLibrary=".\Release/MM64.lib"
    TargetMachine="0"/>

I get the following error:

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

Do I need to create a project on a 64-bit OS or do I need to change the project settings to fix this error. Please help me solve this problem.

+3
source share
5 answers

, ( Visual Studio 2008): Project Properties → Linker → Command Line → Additional Options /MACHINE: I386 .

,

+9

VS2008. , , Build → Configuration Manager, x64 Win32. 32- pre-build 64- .

+2

64- Windows:

, ( Visual Studio 2008): :

Project Properties -> Linker -> Command Line -> Additional Options

/MACHINE:I364 .

.

+2

, ARM64 Visual Studio 2017. ARM64, .

-, ARM64, ( ARM64). , Visual Studio Individual Components -> Visual C++ compiler and libraries for ARM64

error MSB8022: Compiling Desktop applications for the ARM platform is not supported.
,

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
  ...
  <PlatformToolset>v141</PlatformToolset>
  <WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
</PropertyGroup>

. ARM64.

, .

+1

- , - (, x86, - x64). , , . , , , . :

SOME_KIND_OF_OBJECT.obj: fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'AMD64'

obj, . , obj - . , . VS, , . , , , x86 . VS2010 + obj , , , 32-.

0

Source: https://habr.com/ru/post/1739441/


All Articles