问题描述
在64位win7上运行visual c++ 2010,这一行
Running visual c++ 2010 on 64bit win7, this line
#include "C:WindowsSysWOW64user32.dll"
它是正确的路径,但是错误包括
its the correct path, the errors however include variations of
1>C:WindowsSysWOW64user32.dll(1): error C2018: unknown character '0x3'
1>C:WindowsSysWOW64user32.dll(1): error C2018: unknown character '0x4'
1>C:WindowsSysWOW64user32.dll(1): error C2018: unknown character '0x40'
1>C:WindowsSysWOW64user32.dll(1): error C2146: syntax error : missing ';' before identifier 'ÿÿ¸'
1>C:WindowsSysWOW64user32.dll(1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
我正在使用它来让 keybd_event() 工作,因为 msdn 说 User32.dll 是必需的.谢谢 !*注意:错误在代码格式块中,因为否则我不会提交它
I am using it to get keybd_event() working as msdn says User32.dll is a requirement. Thanks !*Note: The errors are in a code format block because it wouldn't let me submit it otherwise
推荐答案
这不是导入库的方式.您只是尝试包含一个二进制文件.这与 32/64 位无关.
That's not how you import libraries. You just tried to include a binary. This has nothing to do with 32/64 bits.
您需要做什么将 user32.lib
添加到您的库路径中.
What you need to do it add user32.lib
to your library path.
您可以通过以下方式在 Visual Studio 中导入库:
You can import a library in Visual Studio by:
Project -> Properties -> Linker -> Additional Dependencies
将user32.lib"添加到列表中.
Add "user32.lib" to the list.
这篇关于Visual C++ 2010 将 User32.dll 导入 64 位 win7 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!