![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,120
Rep Power: 5
![]() |
undeclared identifiers- ack!
Okay, so I have a segment of code which looks something like this:
INPUT inputEvents[4]; inputEvents[0].type = INPUT_KEYBOARD; inputEvents[1].type = INPUT_KEYBOARD; inputEvents[2].type = INPUT_KEYBOARD; inputEvents[3].type = INPUT_KEYBOARD; inputEvents[0].ki.wVk = VK_CONTROL; inputEvents[0].ki.dwFlags = 0; inputEvents[1].ki.wVk = VK_ESCAPE; inputEvents[1].ki.dwFlags = 0; inputEvents[2].ki.wVk = VK_ESCAPE; inputEvents[2].ki.dwFlags = KEYEVENTF_KEYUP; inputEvents[3].ki.wVk = VK_CONTROL; inputEvents[3].ki.dwFlags = KEYEVENTF_KEYUP; Anyways, on to my problem. Both my locally-installed MSDN library and msdn.microsoft.com tell me that INPUT, INPUT_KEYBOARD, and SendInput() are declared in winuser.h, and for me to simply include windows.h. However, whenever I try to compile the code, I receive errors about them being undeclared identifiers. I've looked at winuser.h, and the definition is there; why then can't the compiler see it? I receive the same undefined identifiers using VS.NET 2003 and DevC++, and I have tried both explicitly including the winuser.h header, and letting it be implicitly included through windows.h.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,254
Rep Power: 5
![]() |
The most common reason is that some macro is not defined. Have you set up your application as a windows application or as a console application? If you are building as a console application, there will be various #ifdef .... #endif blocks that might mean the compiler doesn't see some identifiers in the header files.
|
|
|
|
|
|
#3 |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,120
Rep Power: 5
![]() |
I don't believe that's the problem, as with both compilers, I said 'Windows application' when initially creating the project. I'm utterly stumped on this one, but I have a sneaking suspicion that when I do get it worked out, I'll feel like a complete moron.
In other words: your solution's too subtle. I'm probably overlooking something much more obvious. ![]() [edit] I got it figured out. It wasn't the console/'regular' app #define. It was the version; sticking in #define _WIN32_WINNT 0x0500 before #include "windows.h" fixed it. Now I can progress to the interesting parts of my program. I guess it's time for learning sockets programming with my patented 'trial by fire' approach at learning. [/edit]
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick Last edited by lectricpharaoh; Aug 6th, 2006 at 8:03 AM. |
|
|
|
|
|
#4 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,254
Rep Power: 5
![]() |
Quote:
|
|
|
|
|
|
|
#5 | |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,120
Rep Power: 5
![]() |
Quote:
Ahh well. I've gotta get back to coding, and trying to understand the vagaries of the MS development people is an exercise in futility. ![]()
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| undeclared identifier... | Kilo | C++ | 10 | May 22nd, 2006 6:57 PM |
| error C2065: 'unit_counter2' : undeclared identifier | Ade | C++ | 6 | May 15th, 2006 8:11 AM |
| libraries | matko | C | 1 | Jan 22nd, 2006 3:12 PM |
| Undeclared Identifier 'Dini' | Gc671 | Delphi | 3 | Jan 4th, 2006 5:24 PM |