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

查看:603
本文介绍了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?

推荐答案

首先,检查Configuration Manager(构建> Configuration Manager ...),以确保要为同一平台构建所有项目。

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:

为(* .obj * .lib)中的/ R%f @echo%f&& dumpbin /标题%f | findstr / c:机器(x86)

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

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