【问题标题】:Why does this don't work in visual studio 2012 (SP2)为什么这在 Visual Studio 2012 (SP2) 中不起作用
【发布时间】:2013-04-05 21:51:23
【问题描述】:

这应该只是用单词 POINTER 替换 '*'

#define POINTER *

// Define an 8bit byte
typedef unsigned short aByte;

// Define a pointer to an 8bit byte
typedef aByte POINTER aPointerToByte;

这不会在 vs2012 中编译,但它确实在 vs2010 中编译

【问题讨论】:

  • C 还是 C++?我用 C++ 标记了它。如果是,请随意将其更改为 C。代码可以是。
  • 你看到了什么确切的错误?
  • 在 VS2012 上编译得很好。
  • 我得到的错误是 error C2144: syntax error : 'unsigned short' 应该以 ';' 开头

标签: c++ visual-studio-2010 visual-studio-2012 dereference


【解决方案1】:

好的,我不确定我是否理解这一点,但是以某种方式删除这段代码会使问题消失。

#if !defined(__FreeBSD__)
   #include <pcrt32.h>
#endif

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-01
    • 1970-01-01
    • 2023-03-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-13
    相关资源
    最近更新 更多