Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Solution to compilation Error in Visual Studio C when including flies like
"winbase.h and "windef.h"
Moderator:
RSKV

Post Reply
Follow this topic



Solution to compilation Error in Visual Studio C when including flies like
"winbase.h and "windef.h"

gopv posted on 14 Jun 2012 7:52 AM PST
Cypress Employee
20 Forum Posts

Sometimes when you are developing projects in Visual Studio C++ (using cyapi.lib) you may come across below compilation error when including files like #include"winbase.h" and#include"windef.h". This compilation error is not specific to cypress libraries.

One of the solution is to use "windows.h" instead of "winbase.h and "windef.h".This will fix problem in most cases.

If this solution does not work, search in other public forumsfor the answers.


Compliation error message:

1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(6361): error C2146: syntax error : missing ';' before identifier 'ContextRecord'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(6361): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(6361): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(12983): error C2065: 'PCONTEXT' : undeclared identifier
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(12984): error C2146: syntax error : missing ')' before identifier 'ContextRecord'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(12984): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(12984): error C2182: 'RtlCaptureContext' : illegal use of type 'void'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(12984): error C2491: 'RtlCaptureContext' : definition of dllimport data not allowed
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(12984): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(13372): error C2143: syntax error : missing ';' before '__stdcall'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(13372): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(13376): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(14982): error C3861: '__readfsdword': identifier not found
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\Winbase.h(1048): error C2146: syntax error : missing ';' before identifier 'LPCONTEXT'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\Winbase.h(1048): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\Winbase.h(1048): error C2378: 'PCONTEXT' : redefinition; symbol cannot be overloaded with a typedef
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(13372) : see declaration of 'PCONTEXT'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\Winbase.h(1048): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\Winbase.h(3610): error C2061: syntax error : identifier 'PCONTEXT'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\Winbase.h(4449): error C2061: syntax error : identifier 'LPCONTEXT'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\Winbase.h(4457): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\Winbase.h(4457): error C2143: syntax error : missing ',' before '*'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\Winbase.h(15112): error C2143: syntax error : missing ';' before '__stdcall'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\Winbase.h(15112): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\Winbase.h(15116): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int








ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20