Visual Studio - 查找导致 C1905(处理器不兼容)的模块 [英] Visual Studio - Finding which modules are causing C1905 (processor incompatibility)

查看:42
本文介绍了Visual Studio - 查找导致 C1905(处理器不兼容)的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Visual Studio 2005 制作一个 x64 版本的项目.它目前因链接器错误 C1905 失败,前端和后端不兼容(必须以相同的处理器为目标)."

I'm attempting to make an x64 build of a project with Visual Studio 2005. It's currently failing with linker error C1905, 'Front end and back end not compatible (must target same processor).'

据我所知,这实质上是说我的 x64 版本正在尝试与 x86 模块链接.不幸的是,这个项目与很多不同的库相关联.我不确定哪个是导致问题的原因.

From what I gather, this is essentially saying that my x64 build is attempting to link with x86 modules. Unfortunately, this project links with a lot of different libraries. I'm not sure which is the one causing the problem.

有没有办法从 Visual Studio 中获取更多信息?

Is there any way to get more information out of Visual Studio?

推荐答案

首先,检查配置管理器(构建 > 配置管理器...)以确保您正在为同一平台构建所有项目.

First, check Configuration Manager (Build > Configuration Manager...) to ensure that you're building all of your projects for the same platform.

如果这没有帮助,那么从 Visual Studio 命令提示符(可从开始"菜单获得),您可以使用 dumpbin 来确定 .lib 和 .obj 文件的体系结构,方法是执行以下内容:

If that doesn't help, then from the Visual Studio Command Prompt (available from the Start menu), you can use dumpbin to determine the architecture of your .lib and .obj files by doing the following:

C:Foo> dumpbin /headers Foo.lib | more
Microsoft (R) COFF/PE Dumper Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file Foo.lib

File Type: LIBRARY

FILE HEADER VALUES
             14C machine (x86)
               3 number of sections
        4C6CB9B6 time date stamp Wed Aug 18 21:57:26 2010
             113 file pointer to symbol table
               8 number of symbols
               0 size of optional header
             100 characteristics
                   32 bit word machine

标题值下的第一行告诉您 .lib/.obj 是针对哪种架构编译的(在本例中为 x86).

The first line under the header values tells you which architecture the .lib/.obj was compiled for (in this case, x86).

如果您有很多链接的中间体,您可以通过查找 x86(或 x64)文件来自动执行此操作:

If you have a lot of linked intermediates, you could automate this a bit by just looking for x86 (or x64) files:

for/R %f in (*.obj *.lib) do @echo %f &&垃圾箱/headers %f |findstr/c:"machine (x86)"

这篇关于Visual Studio - 查找导致 C1905(处理器不兼容)的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆