【问题标题】:Getting error C2039 on vista32bit while the same code works correctly on XP在 vista32bit 上出现错误 C2039,而相同的代码在 XP 上正常工作
【发布时间】:2011-08-26 01:41:45
【问题描述】:

我使用的是 Visual Studio 2005。我在 XP Windows 中执行了我的代码,它工作正常,但是当我想在 vista32 中执行相同操作时,它开始出现这些错误,这看起来很奇怪。我进行了很多搜索,发现这是一个常见问题,但找不到任何清晰有用的解决方案。如果有人能帮上忙,我将不胜感激。

错误 1 ​​错误 C2039: '_strtoi64' : is not a member of '`global namespace'' c:\program files\microsoft visual studio 8\vc\include\xlocnum 469

错误 2 错误 C3861: '_strtoi64': 找不到标识符 c:\program files\microsoft visual studio 8\vc\include\xlocnum 469

错误 3 错误 C2039: '_strtoi64' : is not a member of '`global namespace'' c:\program files\microsoft visual studio 8\vc\include\xlocnum 469

错误 4 错误 C3861: '_strtoi64': identifier not found c:\program files\microsoft visual studio 8\vc\include\xlocnum 469

错误 5 错误 C2039: '_strtoi64' : is not a member of '`global namespace'' c:\program files\microsoft visual studio 8\vc\include\xlocnum 469

错误 6 错误 C3861: '_strtoi64': identifier not found c:\program files\microsoft visual studio 8\vc\include\xlocnum 469

错误 41 错误 C2039: '_strtoi64' : is not a member of '`global namespace'' c:\program files\microsoft visual studio 8\vc\include\xlocnum 469

错误 42 错误 C3861: '_strtoi64': 找不到标识符 c:\program files\microsoft visual studio 8\vc\include\xlocnum 469

【问题讨论】:

  • 在不同的计算机上执行代码不会出现编译错误。你到底在做什么?
  • 这些都是编译时错误。它们是 Visual Studio 2005 在您正在编译的两台机器上吗?
  • 是的,它们都是 vs 2005,我什至在另一台具有相同 windows(vista) 和相同 VS 的电脑上执行它,并且再次正常工作。我不知道有什么问题?

标签: c++ visual-studio-2005 windows-vista


【解决方案1】:

检查 Visual Studio 依赖项和项目依赖项中的 Include 部分。也许您包含一些带有旧 SDK 标准头的目录。标准目录应位于列表顶部。

【讨论】:

  • 这些是编译错误,因此与运行时库的错误版本无关。 OTOH 安装 Visual Studio 服务包可能会有所帮助。
【解决方案2】:

我刚刚卸载并重新安装了 Visual 2005,令人惊讶的是它的工作原理,感谢您的所有建议。

问候

【讨论】:

    【解决方案3】:

    有人引用了函数 strtoi64( ),它将 C 字符串转换为 64 位整数。但是你是在 32 位系统上运行的,所以没有这样的功能。首先,我会查看有问题的文件,该文件位于其中或附近

    c:\program files\microsoft visual studio 8\vc\include\xlocnum
    

    (不管那是什么)在第 469 行,看看那个人想做什么。

    在我看来,当 VS 安装到 Vista 机器上时,有人以某种方式启用了 64 位编译,所以在我看来,您可能必须检查 VC 配置以确保它们都是 32 位设置。

    【讨论】:

    • 64 位编译与 64 位数据类型无关。我可以在一个 32 位盒子上有一个 64 位整数。无论架构如何,我都可以拥有任意精度的数据类型。
    • @Joe -- 没错。谢谢!
    猜你喜欢
    • 2020-12-03
    • 1970-01-01
    • 1970-01-01
    • 2012-05-02
    • 2015-07-30
    • 1970-01-01
    • 2021-10-09
    • 1970-01-01
    • 2011-08-19
    相关资源
    最近更新 更多