0

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

Jahan
  • 11
  • 3

1 Answers1

0

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

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 02 '22 at 17:54