gpt4 book ai didi

c++ - 如何在 VS 2008 中编译 64 位 native C++ DLL?

转载 作者:行者123 更新时间:2023-11-30 04:40:11 25 4
gpt4 key购买 nike

我正在尝试将 native ATL C++ 进程内 COM 服务器移植到 Visual Studio 2008 中的 64 位。我打开了配置管理器,添加了“x64”平台。现在我有 6 个配置 - 3 个用于 Win32,编译和链接正常,3 个用于 x64,编译正常,但使链接器发出以下错误:

\Debug64\Objects\common.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

我要改变什么才能消除这种情况?

UPD:已解决,问题来源非常愚蠢,请参阅下面的回答。

最佳答案

您是否在安装 visual studio 期间安装了“x64 compiler and tools”组件?

还要检查这些设置:( copied from msdn )

  • /MACHINE (Specify Target Platform) is set to /MACHINE:IA64 or /MACHINE:X64.

  • Register Output is turned OFF. For more information, see Linker Property Pages.

  • Target Environment is set to /env x64 or /env ia64. For more information, see MIDL Property Pages: General.

  • Validate Parameters is cleared and reset to the default value. For more information, see MIDL Property Pages: Advanced.

  • If Debug Information Format was set to /ZI in the Win32 project configuration, then it is set to /Zi in the 64-bit project configuration. For more information, see /Z7, /Zi, /ZI (Debug Information Format).

  • Values of WIN32 are replaced by WIN64 for /D (Preprocessor Definitions).

关于c++ - 如何在 VS 2008 中编译 64 位 native C++ DLL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1667316/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com