Bartlomiej Lewandowski
Bartlomiej Lewandowski

Reputation: 11180

Include winnt.h in my project

I am doing a small personal project involving printing out info about a PE file. I have read that most of the pe structure is already defined in winnt.h header.

Upon including the winnt.h, and compiling the project i get the following error:

#error :  "No Target Architecture"

I tried putting a define x86, it might have fixed the architecture problem, but there are even more compilation problems.

For example:

1>c:\program files (x86)\windows kits\8.0\include\um\winnt.h(363): error C2146: syntax error : missing ';' before identifier 'WCHAR'
1>c:\program files (x86)\windows kits\8.0\include\um\winnt.h(363): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\um\winnt.h(367): error C2143: syntax error : missing ';' before '*'
1>c:\program files (x86)\windows kits\8.0\include\um\winnt.h(367): error C2040: 'PWSTR' : 'CONST' differs in levels of indirection from 'WCHAR *'

Upvotes: 0

Views: 7493

Answers (1)

Tom J Muthirenthi
Tom J Muthirenthi

Reputation: 3340

check Compiler->Enable Microsoft extensions in Project options or use -Ze flag if you're compiling from the command line.

Upvotes: 3

Related Questions