0

I feel like this should work...

#include <d2d1.h>
int main ()
{
    return 0;
};

...but it comes up with a bunch of this...

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|

...and so on.

I'm using MinGW on Code::Blocks compiling C++ for Windows. Right now my only compiler option is -mingw32. If you know what this result might mean and how I can fix it in the C::B options or where ever I need to change something, that would really help.

-- UPDATE --

I blank-defined what I assumed to be troublesome Visual Studio macros.

#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;
};

However, now in d2d1.h I'm still getting this issue:

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) ===|

Since it's not a preprocessor issue, I want even less to tamper, since I'd have to change around the actual header. Any ideas on how to fix this?

rsethc
  • 2,485
  • 2
  • 17
  • 27
  • In Code::Blocks under Settings menu, select Compiler Settings. On that dialog box, check your entries under the Search DIrectories tab, both compiler (for headers) and linker (for binaries). Make sure the necessary paths are present for the libraries you are using. Also note there is a difference between #include and #include "d2d1.h" See ***[Here](http://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename)*** – ryyker Sep 08 '13 at 20:15
  • It's not a problem with including the header, it's a problem with the actual headers: likely that they were written in VC++ and there is some small issue that confuses MinGW. – rsethc Sep 09 '13 at 18:59
  • I suppose you have already looked at lines 1246, 1269, 1333 and 1374 to see if there might be something in common. Code::Blocks is not my primary environment, so I am not often able to jump quickly to root problems. I use MinGW with ***C::B***, and even after configuring ***it*** as the default compiler during setup, there were still references to Microsoft's environment in the compiler settings, et. al. – ryyker Sep 09 '13 at 22:51
  • Not sure why do you use MinGW to work with Direct2D, that's really not a good choice. – zdd Sep 10 '13 at 01:34
  • @ryyker: On those four lines there are class interfaces that look sort of weird but I (1) don't want to assume more than I have to and perhaps mess up the header (2) don't want to edit the header at all if I don't have to. – rsethc Sep 13 '13 at 02:59
  • @zdd: Is there any other good, free, dependable compiler for Windows excluding the ones that come with Visual Studio? – rsethc Sep 13 '13 at 03:00
  • @rsethc sorry, I don't kown, I am using Visual Studio Express version, but it seems you don't like it. – zdd Sep 13 '13 at 04:22

0 Answers0