So, my question is how to fix some error in header file, to run program normally? For example I use c++ builder 2010 and when winuser.h file is included, the program always get error like this
Checking project dependencies…
Compiling Project7.cbproj (Debug
configuration) [BCC32 Error]
winuser.h(47): E2257 , expected Full
parser context
File6.cpp(4): #include c:program files (x86)embarcaderorad
studio7.0includewinuser.h [BCC32
Error] winuser.h(48): E2257 , expected
Full parser context
i try to replace that file with original from default installation, but that still get same error, how to fix that?
asked Dec 13, 2010 at 22:17
The error is almost certainly caused by whatever code appears before line 4 of File6.cpp. Most likely that is another header file, in which case it is likely that the code therein is malformed — a missing semicolon or brace for example.
The quickest way to verify that winuser.h is not the issue is to change the order of inclusion so that winuser.h is included first.
Another possibility is that something in winuser.h is dependent on some other header not previously included or directly included in winuser.h. Most Win32 API headers are included by windows.h, and it is generally advisable to include windows,h rather than either of its children.
answered Dec 13, 2010 at 22:37
CliffordClifford
86k12 gold badges85 silver badges160 bronze badges
5
The message is hard to read but the actual error is «E2257 , expected» (coma expected)
From the RAD studio documentation:
A comma was expected in a list of declarations, initializations, or parameters.
This problem is often caused by a missing syntax element earlier in the file
or one of its included headers.
The error message give you the line where it happened and you should probably look before that. There is probably some ‘}’, ‘)’ or ‘;’ or other syntaxic closer missing in your code just before the error (likely before inclusion of the header file in your code). Full error message (you truncated it) or actual code would make it easier to spot.
It is also possible, even if unlikely, that the error is in one of the headers included in winuser.h
.
answered Dec 13, 2010 at 22:28
krisskriss
23.1k17 gold badges97 silver badges115 bronze badges
3
- Remove From My Forums
-
Question
-
Everytime i try to include winuser.h i get this:
C:ProgramMicrosoft Visual Studio
8VCPlatformSDKincludewinuser.h(42) : error C2146: syntax error :
missing ‘;’ before identifier ‘HDWP’
C:ProgramMicrosoft Visual
Studio 8VCPlatformSDKincludewinuser.h(42) : error C4430: missing
type specifier — int assumed. Note: C++ does not support default-int
C:ProgramMicrosoft Visual Studio
8VCPlatformSDKincludewinuser.h(42) : error C4430: missing type
specifier — int assumed. Note: C++ does not support default-int
C:ProgramMicrosoft Visual Studio
8VCPlatformSDKincludewinuser.h(43) : error C2146: syntax error :
missing ‘;’ before identifier ‘MENUTEMPLATEA’
C:ProgramMicrosoft
Visual Studio 8VCPlatformSDKincludewinuser.h(43) : error C4430:
missing type specifier — int assumed. Note: C++ does not support
default-int
C:ProgramMicrosoft Visual Studio
8VCPlatformSDKincludewinuser.h(43) : error C4430: missing type
specifier — int assumed. Note: C++ does not support default-int
C:ProgramMicrosoft Visual Studio
8VCPlatformSDKincludewinuser.h(50) : error C2146: syntax error :
missing ‘;’ before identifier ‘LPMENUTEMPLATEA’
C:ProgramMicrosoft Visual Studio
8VCPlatformSDKincludewinuser.h(50) : error C4430: missing type
specifier — int assumed. Note: C++ does not support default-int
C:ProgramMicrosoft Visual Studio
8VCPlatformSDKincludewinuser.h(50) : error C4430: missing type
specifier — int assumed. Note: C++ does not support default-int
C:ProgramMicrosoft Visual Studio 8VCPlatformSDKincludewinuser.h(58) : error C2065: ‘CALLBACK’ : undeclared identifier
C:ProgramMicrosoft Visual Studio 8VCPlatformSDKincludewinuser.h(58) : error C2065: ‘WNDPROC’ : undeclared identifier
C:ProgramMicrosoft Visual Studio
8VCPlatformSDKincludewinuser.h(58) : error C4430: missing type
specifier — int assumed. Note: C++ does not support default-int
C:ProgramMicrosoft Visual Studio
8VCPlatformSDKincludewinuser.h(58) : fatal error C1903: unable to
recover from previous error(s); stopping compilation
please help
Answers
-
After some discussion over IM it seems there might be a problem with ThE ViKinG’s C++/platform SDK installation.
Last Updated: 07/02/2022
[Average Article Time to Read: 4.7 minutes]
Winuser.h is considered a type of C/C++/Objective-C Header file. It is most-commonly used in C-Free 5.0 Pro developed by Program Arts. It uses the H file extension and is considered a Developer (C/C++/Objective-C Header) file.
Winuser.h was first released in the Windows 10 Operating System on 04/27/2015 with Orwell Dev-C++ 5.11.
The latest file update released for C-Free 5.0 Pro was on 01/04/2010 [file version 5.0 Pro].
Winuser.h is included with C-Free 5.0 Pro, MATLAB R2009a, and Microsoft Visual Studio 2010 Ultimate 2010.
In this article, you will find detailed winuser.h information, a H file troubleshooting guide, and a list of versions that are available for free download.
What are winuser.h Error Messages?
General winuser.h Runtime Errors
Winuser.h file errors often occur during the startup phase of C-Free, but can also occur while the program is running.
These types H errors are also known as “runtime errors” because they occur while C-Free is running. Here are some of the most common winuser.h runtime errors:
- winuser.h could not be found.
- winuser.h error.
- winuser.h failed to load.
- Error loading winuser.h.
- Failed to register winuser.h / Cannot register winuser.h.
- Runtime Error — winuser.h.
- The file winuser.h is missing or corrupt.
Microsoft Visual C++ Runtime Library
Runtime Error!
Program: C:Program Files (x86)C-Free 5mingwincludewinuser.h
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application’s support team for more information.
Most H errors are due to missing or corrupt files. Your winuser.h file could be missing due to accidental deletion, uninstalled as a shared file of another program (shared with C-Free), or deleted by a malware infection. Furthermore, winuser.h file corruption could be caused from a power outage when loading C-Free, system crash while loading or saving winuser.h, bad sectors on your storage media (usually your primary hard drive), or malware infection. Thus, it’s critical to make sure your anti-virus is kept up-to-date and scanning regularly.
How to Fix winuser.h Errors in 3 Steps (Time to complete: ~5-15 minutes)
If you’re encountering one of the error messages above, follow these troubleshooting steps to resolve your winuser.h issue. These troubleshooting steps are listed in the recommended order of execution.
Step 1: Restore your PC back to the latest restore point, «snapshot», or backup image before error occurred.
To begin System Restore (Windows XP, Vista, 7, 8, and 10):
- Hit the Windows Start button
- When you see the search box, type «System Restore» and press «ENTER«.
- In the search results, find and click System Restore.
- Please enter the administrator password (if applicable / prompted).
- Follow the steps in the System Restore Wizard to choose a relevant restore point.
- Restore your computer to that backup image.
If the Step 1 fails to resolve the winuser.h error, please proceed to the Step 2 below.
Step 2: If recently installed C-Free (or related software), uninstall then try reinstalling C-Free software.
You can uninstall C-Free software by following these instructions (Windows XP, Vista, 7, 8, and 10):
- Hit the Windows Start button
- In the search box, type «Uninstall» and press «ENTER«.
- In the search results, find and click «Add or Remove Programs«
- Find the entry for C-Free 5.0 Pro and click «Uninstall«
- Follow the prompts for uninstallation.
After the software has been fully uninstalled, restart your PC and reinstall C-Free software.
If this Step 2 fails as well, please proceed to the Step 3 below.
C-Free 5.0 Pro
Program Arts
Step 3: Perform a Windows Update.
When the first two steps haven’t solved your issue, it might be a good idea to run Windows Update. Many winuser.h error messages that are encountered can be contributed to an outdated Windows Operating System. To run Windows Update, please follow these easy steps:
- Hit the Windows Start button
- In the search box, type «Update» and press «ENTER«.
- In the Windows Update dialog box, click «Check for Updates» (or similar button depending on your Windows version)
- If updates are available for download, click «Install Updates«.
- After the update is completed, restart your PC.
If Windows Update failed to resolve the winuser.h error message, please proceed to next step. Please note that this final step is recommended for advanced PC users only.
If Those Steps Fail: Download and Replace Your winuser.h File (Caution: Advanced)
If none of the previous three troubleshooting steps have resolved your issue, you can try a more aggressive approach (Note: Not recommended for amateur PC users) by downloading and replacing your appropriate winuser.h file version. We maintain a comprehensive database of 100% malware-free winuser.h files for every applicable version of C-Free. Please follow the steps below to download and properly replace you file:
- Locate your Windows operating system version in the list of below «Download winuser.h Files».
- Click the appropriate «Download Now» button and download your Windows file version.
- Copy this file to the appropriate C-Free folder location:
Windows 10: C:Program FilesMATLABR2019bsyslccinclude
Windows 10: C:Program Files (x86)C-Free 5mingwinclude
Windows 10: C:Program Files (x86)Dev-CppMinGW64x86_64-w64-mingw32include
Windows 10: C:Program Files (x86)Microsoft SDKsWindowsv7.0AInclude
Windows 10: C:Program FilesMATLABR2019bsyslcc64lcc64include64 - Restart your computer.
If this final step has failed and you’re still encountering the error, you’re only remaining option is to do a clean installation of Windows 10.
GEEK TIP : We must emphasize that reinstalling Windows will be a very time-consuming and advanced task to resolve winuser.h problems. To avoid data loss, you must be sure that you have backed-up all of your important documents, pictures, software installers, and other personal data before beginning the process. If you are not currently backing up your data, you need to do so immediately.
Download winuser.h Files (Malware-Tested 100% Clean)
CAUTION : We strongly advise against downloading and copying winuser.h to your appropriate Windows system directory. Program Arts typically does not release C-Free H files for download because they are bundled together inside of a software installer. The installer’s task is to ensure that all correct verifications have been made before installing and placing winuser.h and all other H files for C-Free. An incorrectly installed H file may create system instability and could cause your program or operating system to stop functioning altogether. Proceed with caution.
You are downloading trial software. The purchase of a one-year software subscription at the price of $39.95 USD is required to unlock all software features. Subscription auto-renews at the end of the term (Learn more). By clicking the «Start Download» button above and installing «Software», I acknowledge I have read and agree to the Solvusoft End User License Agreement and Privacy Policy.
I’m pretty unexperienced in c++ which is why I wanted to create some stuff for learning. However I ran into this problem:
I started using certain Windows functions for a recent project. For this I wanted to switch over to minGW w64 from the normal minGW. After installing and setting up the PATH variable I can compile basic cpp code as usual but as soon as I include one of the provided header files — winuser.h to be exact — the compiler shows countless errors found inside that header file. (downloaded it from https://sourceforge.net/projects/mingw-w64/ )
After multiple attempts of reinstalling without further success I tried setting it up inside a clean virtual machine of win10 64-bit with the same results.
For this i tested the following code:
#include "winuser.h"
int main() {
return 0;
}
Compiled with
g++ main.cpp -o test
When removing the #include line it compiles just fine. But otherwise I get the following:
c:mingwmingw64x86_64-w64-mingw32includewinuser.h:25:11: error: 'HANDLE' does not name a type
typedef HANDLE HDWP;
^
c:mingwmingw64x86_64-w64-mingw32includewinuser.h:26:11: error: 'VOID' does not name a type
typedef VOID MENUTEMPLATEA;
^
c:mingwmingw64x86_64-w64-mingw32includewinuser.h:27:11: error: 'VOID' does not name a type
typedef VOID MENUTEMPLATEW;
^
c:mingwmingw64x86_64-w64-mingw32includewinuser.h:28:11: error: 'PVOID' does not name a type
typedef PVOID LPMENUTEMPLATEA;
^
c:mingwmingw64x86_64-w64-mingw32includewinuser.h:29:11: error: 'PVOID' does not name a type
typedef PVOID LPMENUTEMPLATEW;
^
And many many more of these. It seems as if some include inside of this header file is corrupt or something.
For installing mingw w64 I chose the following options:
Version: 8.1.0
Architecture: x86_64
Threads: win32
Exception: seh
Build revision: 0
I should note that the usage of winuser.h worked just fine using the normal minGW.
I feel like I am missing a step to do after the setup to use this. Or is this specific header file depreceated? When including a different header (windows.h for example) file from the same folder for testing I get not errors and the compilation works.
I had difficulties finding something related to this in Google so I thought to ask in here.
Максим2001 7 / 7 / 3 Регистрация: 11.01.2012 Сообщений: 85 |
||||
1 |
||||
29.05.2013, 21:59. Показов 6370. Ответов 4 Метки нет (Все метки)
При попытке подключения к winuser.h у меня компилятор (VC++) выводит:
Операционная система: Windows 7 x86 Ultimate. Может хеадэр ломанный? Добавлено через 19 минут
__________________
0 |
Супер-модератор 32451 / 20945 / 8105 Регистрация: 22.10.2011 Сообщений: 36,213 Записей в блоге: 7 |
|
30.05.2013, 11:26 |
2 |
А зачем ты подключаешь winuser.h? Подключай windows.h, он сам подключит всё что надо…
0 |
7 / 7 / 3 Регистрация: 11.01.2012 Сообщений: 85 |
|
30.05.2013, 16:36 [ТС] |
3 |
А где мне SendInput взять? В user32.dll. Его хеадер — winuser.h. А он не подключается. Пробовал взять хеадер из файлов AutoIt 3 (там есть что-то наподобие) — тоже проблемы. А мне очень нужно. Может быть существуют аналоги? Или другой хеадер для user32.dll? P. S. Попробовал на другом компиляторе — те же самые ошибки. Заменял winuser.h с другого компьютера — ноль изменений. Может быть не туда подключаю или не так?
0 |
Супер-модератор 32451 / 20945 / 8105 Регистрация: 22.10.2011 Сообщений: 36,213 Записей в блоге: 7 |
|
30.05.2013, 16:57 |
4 |
Я тебе написал, что не так. Читай MSDN, если не веришь тому, что тебе пишут (зачем спрашивать тогда?) Header Каким цветом тебе выделить это, чтоб ты увидел, ЧТО надо подключить?
1 |
7 / 7 / 3 Регистрация: 11.01.2012 Сообщений: 85 |
|
30.05.2013, 17:00 [ТС] |
5 |
UI, безмерно вам благодарен!!!
0 |
- Forum
- General Programming Boards
- C++ Programming
- Errors in winuser.h
-
06-23-2002
#1
Registered User
Errors in winuser.h
I have included winuser.h in my application to support the MessageBox function.
When I compile my application, I get the following 2 errors:
winuser.h(39) : error C2146: syntax error : missing ‘;’ before identifier ‘HDWP’
and
winuser.h(39) : fatal error C1004: unexpected end of file found
When I looked at the file in the editor and double clicked on the first error in the debug window, it brought me to this line (39):
typedef HANDLE HDWP;
which doesn’t look any different than the other typedefs.
Now, this file was installed when I installed Visual C++ 6.0 ~ so I don’t understand why it has errors… what can I do?
By the way, I am using Microsoft Visual Studio 6.0 — and I am relatively new to C++
Welcome to the funhouse, where strange mirrors reflect the faces of insanity.
-
06-23-2002
#2
and the hat of int overfl
did you include windows.h first?
-
06-23-2002
#3
winuser.h is included in windows.h.
Just include the windows header, it will work.
-
06-23-2002
#4
Registered User
Thank you both… I actually had both included in my program so it was most likely causing confusion with the compiler.
I removed winuser.h and all seems to be well.
Welcome to the funhouse, where strange mirrors reflect the faces of insanity.
Popular pages
- Exactly how to get started with C++ (or C) today
- C Tutorial
- C++ Tutorial
- 5 ways you can learn to program faster
- The 5 Most Common Problems New Programmers Face
- How to set up a compiler
- 8 Common programming Mistakes
- What is C++11?
- Creating a game, from start to finish
Recent additions
- How to create a shared library on Linux with GCC — December 30, 2011
- Enum classes and nullptr in C++11 — November 27, 2011
- Learn about The Hash Table — November 20, 2011
- Rvalue References and Move Semantics in C++11 — November 13, 2011
- C and C++ for Java Programmers — November 5, 2011
- A Gentle Introduction to C++ IO Streams — October 10, 2011
Similar Threads
-
Replies: 9
Last Post: 04-02-2008, 03:11 PM
-
Ten Errors
By AverageSoftware in forum Contests Board
Replies: 0
Last Post: 07-20-2007, 10:50 AM
-
Replies: 16
Last Post: 04-06-2004, 02:57 PM
-
Replies: 9
Last Post: 11-30-2003, 05:44 PM
-
Replies: 6
Last Post: 09-07-2003, 08:18 PM
I have tried this on 3 different computers, two different compilers (dev-cpp 4, 5 and MS-visual studio), and why does it give me errors in the winuser.h file? I have even tried downloading a different one and it didnt fix it. Please help.
here are the errors:
c:program filesmicrosoft visual studiovc98includewinuser.h(40) : error C2146: syntax error : missing »;» before identifier »MENUTEMPLATEA»
c:program filesmicrosoft visual studiovc98includewinuser.h(40) : fatal error C1004: unexpected end of file found
Did you try putting a semi-colon where it says it needs one?
———
«Hey, what about those baggy pants you kids are wearin» these days? Aren»t they hip and cool and poppin» fresh?»-Peter Griffin
«Everytime I see an M followed by a dollar sign I just say «oh god» and go to the next post.»-Neurokaotix
the D programming language|google|msdn|XLib reference manual
how would that help? I have run it on 3 different computers, and 2 compilers. And where should this semi colon go?
Here are the few lines around the error:
#ifndef _WINUSER_#define _WINUSER_//// Define API decoration for direct importing of DLL references.//#if !defined(_USER32_)#define WINUSERAPI DECLSPEC_IMPORT#else#define WINUSERAPI#endif#ifdef _MAC#include <macwin32.h>#endif#ifdef __cplusplusextern "C" {#endif /* __cplusplus */#ifndef WINVER#define WINVER 0x0500 /* version 5.0 */#endif /* !WINVER */#include <stdarg.h>#ifndef NOUSERtypedef HANDLE HDWP;/*this line has the error*/typedef VOID MENUTEMPLATEA;typedef VOID MENUTEMPLATEW;#ifdef UNICODEtypedef MENUTEMPLATEW MENUTEMPLATE;#elsetypedef MENUTEMPLATEA MENUTEMPLATE;#endif // UNICODEtypedef PVOID LPMENUTEMPLATEA;typedef PVOID LPMENUTEMPLATEW;#ifdef UNICODEtypedef LPMENUTEMPLATEW LPMENUTEMPLATE;#elsetypedef LPMENUTEMPLATEA LPMENUTEMPLATE;#endif // UNICODEtypedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
[edited by — ShadowHunter on December 10, 2003 9:34:49 PM]
[edited by — ShadowHunter on December 10, 2003 9:35:48 PM]
I would say that unless you modified winuser.h, despite what the compiler says error is not in that file.
No, I have not modified that file. If your theory is correct how do you explain getting an error in a program that only loads that one file and prints out hi on the screen?
winuser.h can not stand on its own. The reason your having problems with it is that VOID has not been defined yet. I’m not sure which other files you need… Perhaps including windows.h will fix it.
-Shags
edit- It looks like windows.h includes winuser.h so you could just include windows.h (This works for me and fixes the compiler issues on my machine)
[edited by — Shags on December 10, 2003 9:55:49 PM]
0
down vote
favorite
i try to create CLR Class library like this
#include «Stdafx.h»
#include «Image.h»
#include <msclrmarshal_cppstd.h>
namespace Vas
{
/// <summary>
/// Initializes a new instance of the <see cref=»Image»/> class.
/// </summary>
Image::Image(int width, int height)
{
_mat = new cv::Mat(height, width, CV_8UC4);
}
///
Image::Image(System::String^ path)
{
std::string str = msclr::interop::marshal_as<std::string>(path);
_mat = new cv::Mat();
(*_mat) = cv::imread(str);
}
/// <summary>
/// Finalizes an instance of the <see cref=»Image»/> class.
/// </summary>
Image::~Image()
{
if (_isDisposed)
return;
this->!Image();
_isDisposed = true;
}
Image::!Image()
{
delete _mat;
}
/// <summary>
/// Sets the specified data.
/// </summary>
/// <param name=»data»>The data.</param>
void Image::Set(array<unsigned char>^ data)
{
pin_ptr<unsigned char> ptr = &data[0];
unsigned char* src = ptr;
int size = _mat->rows * _mat->step;
memcpy_s(_mat->data, size, src, size);
}
///
void Image::Save(System::String^ path)
{
std::string str = msclr::interop::marshal_as<std::string>(path);
cv::imwrite(str, *_mat);
}
}
when i build this code, winuser.h is error like this:
error C2059: syntax error : ‘)’ error C2059: syntax error : ‘)’
error C2059: syntax error : ‘)’
error C2059: syntax error : ‘)’
error C2143: syntax error : missing ‘;’ before ‘__stdcall’
error C2143: syntax error : missing ‘;’ before ‘__stdcall’
error C2146: syntax error : missing ‘)’ before identifier ‘hDesktop’
error C2146: syntax error : missing ‘)’ before identifier ‘hDesktop’
error C2146: syntax error : missing ‘)’ before identifier ‘hDesktop’
error C2146: syntax error : missing ‘)’ before identifier ‘hDesktop’
error C2146: syntax error : missing ‘;’ before identifier ‘hdesk’
error C2377: ‘HDESK’ : redefinition; typedef cannot be overloaded with any other symbol error C2440: ‘initializing’ : cannot convert from ‘HDESK’ to ‘BOOL’
error C2440: ‘initializing’ : cannot convert from ‘HDESK’ to ‘BOOL’
error C2440: ‘initializing’ : cannot convert from ‘HDESK’ to ‘BOOL’
error C2440: ‘initializing’ : cannot convert from ‘HDESK’ to ‘BOOL’
i try to found winuser.h or windows.h and i want to remove from my file, but i cannot foud it.
can come one tell me, why the error is come? and how to solve it? i’m already search on google and still cannot found the answer
Topic archived. No new replies allowed.