Eclipse and Windows Headers

658 views Asked by At

I'm using Eclipse CDT and have a c project that included standard windows header "windows.h". What do you suggest to resolve the following errors? I do not have access to these standard headers and I should not have. When I just include "windows.h" and compile the following errors appear in the error list while I have not referenced any of these headers. MinGW toolchain - CDT Internal is used. This pretty seems strange maybe I have to change the compiler?

winnt.h: #error Must define a target architecture.

winnt.h: unknown type name "EXCEPTION_DISPOSITION"

propidl.h: array type has incomplete element type

excpt.h: conflicting types for "EXCEPTION_REGISTRATION_RECORD"

wtypes.h: expected specifier-qualifier-list before "/" token

wtypes.h: pasting "/" and "/" does not give a valid preprocessing token

winioctl.h: flexible array member in union

1

There are 1 answers

1
Bradley Smith On

Adding -mwindows to the command line patterns field for the MinGW C++ linker worked for me (Project Settings > C/C++ Build > Settings > MinGW C++ Linker > Command line patterns).

Screenshot of Settings window:

Screenshot of Settings window