我觉得这应该工作......
#include <d2d1.h>
int main ()
{
return 0;
};
......但它想出了一堆这个......
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\dxgi.h|286|error: '__in' has not been declared|
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\dxgi.h|286|error: expected ',' or '...' before '&' token|
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\dxgi.h|293|error: '__in' has not been declared|
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\dxgi.h|293|error: expected ',' or '...' before '&' token|
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\dxgi.h|299|error: '__in' has not been declared|
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\dxgi.h|299|error: expected ',' or '...' before '&' token|
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\dxgi.h|307|error: '__in' has not been declared|
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\dxgi.h|307|error: expected ',' or '...' before '&' token|
...等等。
我在 Code::Blocks 上使用 MinGW 为 Windows 编译 C++。现在我唯一的编译器选项是-mingw32
. 如果你知道这个结果可能意味着什么,以及我如何在 C::B 选项中修复它,或者我需要改变什么,那真的很有帮助。
- 更新 -
我空白定义了我认为是麻烦的 Visual Studio 宏。
#define __in
#define __out
#define __in_opt
#define __inout
#define __in_bcount(x)
#define __in_ecount(x)
#define __out_ecount(x)
#define __out_bcount(x)
#define __out_ecount_part_opt(x,y)
#define __out_bcount_opt(x)
#define __in_bcount_opt(x)
#define __in_ecount_opt(x)
#define __out_ecount_opt(x)
#define __out_opt
#define __inout_opt
#include <d2d1.h>
int main ()
{
return 0;
};
但是,现在d2d1.h
我仍然遇到这个问题:
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d2d1.h|1246|error: expected initializer before ':' token|
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d2d1.h|1269|error: expected initializer before ':' token|
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d2d1.h|1333|error: expected initializer before ':' token|
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d2d1.h|1374|error: expected initializer before ':' token|
||=== Build finished: 4 errors, 0 warnings (0 minutes, 2 seconds) ===|
由于这不是预处理器问题,因此我更不想篡改,因为我必须更改实际的标头。有想法该怎么解决这个吗?