VC9: LINK : warning LNK4068: /MACHINE not specified; defaulting to X86

2023-10-28

当把32位程序改成X64的配置编译后,可能会出现错误:

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

通常是因为某些编译单元被编译成了X86的机器码,进一步的原因是编译选项中缺少
/MACHINE,默认会选择X86;在属性中的link面板中加入/MACHINE:X64
即可。

 

The error is explicit, you are trying to link libraries that were compiled with different CPU targets. An executable image can only contain pure x86 (32-bit) or pure x64 (64-bit) code. Mixing is not possible.

You change the target CPU by creating a new configuration for the project, only changing the linker setting isn't enough. Build + Configuration Manager, Active solution platform combo on upper right, choose New and select x64. That creates a new configuration with several modified project settings, most importantly the compiler that will be used.

Beware that prior to VS2010, the 64-bit compilers are not installed by default. If you don't see x64 in the platform combo then you'll need to re-run setup.exe and turn on the option to install the 64-bit compilers. Then also re-run any service pack installer you may have applied.

A possible approach with less pain points is to use the 32-bit version of the library.

bumped into this too and found a solution.

First on how I got into this problem. I have a project which builds in x86. Then I use the Configuration Manager to add x64, and I hit this problem.

By looking at BuildLog.htm carefully, I see both of these listed as linker options: /MACHINE:X64
/machine:X86

I can't find any where in the Property Pages dialog where I can change this, so I open up the .vcproj file and look for the appropriate line and change it to: AdditionalOptions=" /STACK:10000000 /machine:x64 /debug"

 

转载于:https://www.cnblogs.com/xiayong123/archive/2012/03/23/3717362.html

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

VC9: LINK : warning LNK4068: /MACHINE not specified; defaulting to X86 的相关文章

  • linux 之sed '1!G;h;$!d' file 的详细解释

    sed 1 G h d file 与tac file 命令执行结果相同 都是将行逆序输出 这条命令的详细解释 1 sed简介 sed是面向流的行编辑器 所谓面向流 是指接受标准输入的输入 输出内容到标准输出上 sed编辑器逐行处理文件 或输
  • python机器学习——图像内容分析

    计算机视觉 计算机视觉是一门研究如何使机器 看 的科学 更进一步的说 就是是指用摄影机和电脑代替人眼对目标进行识别 跟踪和测量等机器视觉 并进一步做图形处理 使电脑处理成为更适合人眼观察或传送给仪器检测的图像 计算机视觉包括多个级别的分析
  • Premiere Pro入门

    介绍 Adobe Premiere Pro 简称PR 是最强大的视频编辑软件 可同时创建多个时间轨道 多个视频素材按层遮挡 可对单个素材添加各种效果 例如放缩 移动 旋转 裁剪等 可插入图片遮挡视频素材 并且支持png透明 可添加字幕 可导
  • 新版Spring Boot(11)- Spring Boot 整合NoSQL(1)

    1 整合redis 单测 package com tzb cachespringboot import com tzb cachespringboot model User import org junit jupiter api Test
  • C++ 引用 解引用 取地址 指针 双指针 指针的引用 二级指针

    为了把引用 解引用 取地址 指针 双指针 指针的引用 二级指针 这一块弄清楚 钻研与查阅资料得到如下体会 1 引用与取地址 reference and address 引用的 前面一定有类型符号 否则就不是引用 取地址的 后面一定有变量名称
  • 景联文数据标注:AI大模型在教育和医疗领域的应用

    8月31日消息 备受行业瞩目的首批大模型产品获批名单发布 首批通过备案的8家大模型公司分别是 百度 文心一言 抖音 云雀大模型 智谱AI GLM大模型 中科院 紫东太初大模型 百川智能 百川大模型 商汤 日日新大模型 MiniMax ABA
  • 下载Git速度太慢的解决方法【记录】

    直接传送门 点击此链接即可进入git的下载仓库 https registry npmmirror com binary html path git for windows 如下图所示 点击选择你需要的版本进去下载就行了 这里记录一下 备忘
  • Qt 常用类 (4)—— QPoint

    QPoint 类代表一个坐标点 实现在 QtCore 共享库中 它可以认为是一个整型的横坐标和一个整型的纵坐标的组合 构造 QPoint 类支持以下两种构造方式 plain view plaincopy QPoint 构造横纵坐标均为 0
  • 静态链表的基本操作

    定义 用数组描述的链表叫做静态链表 这种描述方法还有起名叫做游标实现法 基本操作 Status InitList StaticLinkList space 将一维数组space中各分量链成一个备用链表 int Malloc SLL Stat
  • 以太坊区块与区块头数据结构解析

    Block数据结构解析 源代码 Block represents an entire block in the Ethereum blockchain type Block struct header Header uncles Heade
  • IBM MQ命令:DEFINE AUTHINFO

    此命令里有很多内容值得一看 https www ibm com docs en ibm mq 8 0 topic commands define authinfo q085490 6 一 CHCKCLNT CHCKCLNT This att
  • Git使用详解(结合GitLab和GitHub)

    转载请注明出处 https blog csdn net mythmayor article details 82346539 如果你想了解更多关于GitHub使用的问题 欢迎查看我的另一篇博客进行学习与交流 GitHub的使用详解 一 Gi
  • VC++读目录下所有文件

    include
  • ChatGPT训练营来啦,手把手带你玩转ChatGPT~

    ChatGPT的出现为测试行业带来了新的机遇和挑战 尽管许多人担心它的强大可能会取代测试人员 但实际上ChatGPT可以成为测试人员的强大助手 提高测试工作的效率和准确性 那么 我们应该如何借助 ChatGPT 让我们的测试工作更高效呢 C
  • Lua 随机数生成问题

    原文链接 http blog csdn net zhangxaochen article details 8095007 Lua 生成随机数需要用到两个函数 math randomseed xx math random n m 1 math
  • Win10开启热点共享后断网怎么解决?

    描述 关闭热点一切正常 打开热点以后电脑浏览器无法联网 最后发现可能是windows更新导致的 卸载了2022 06 17的更新就好了 因为没有去看dism 是什么东西 怕有木马啥的 就选择方法二卸载了2022 06 17的更新就好了 参考
  • QCustomPlot 使用——绘制折线图

    初始化数据 QVector
  • 检测模型设计准则

    作者 小书童 编辑 集智书童 点击下方卡片 关注 自动驾驶之心 公众号 ADAS巨卷干货 即可获取 点击进入 自动驾驶之心 目标检测 技术交流群 后台回复 2D检测综述 获取鱼眼检测 实时检测 通用2D检测等近5年内所有综述 设计高效 高质
  • 电路板布局

    一 PCB布局要求 1 可制造性设计 DFM 可装配性 DFA 可维修性 DFS 可测试性 DFT 2 电气性能实现 ccc fcc ce认证 EMC SI PI及散热要求 3 合理的成本 层数也多成本越高 4 美观度 二 布局的一般原则
  • uni封装ajax,uni-app封装ajax请求方法

    位置项目根目录index js 定义了两种请求get和post import baseconfig from common baseconfig js const httpClient request function method url

随机推荐