Visual C ++ 2010错误导入User32.dll到64位win7 [英] visual c++ 2010 errors importing User32.dll into 64bit win7

查看:207
本文介绍了Visual C ++ 2010错误导入User32.dll到64位win7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在64位win7上运行visual c ++ 2010,这行

Running visual c++ 2010 on 64bit win7, this line

#include "C:\Windows\SysWOW64\user32.dll"

它的路径正确,错误包括

its the correct path, the errors however include variations of

1>C:\Windows\SysWOW64\user32.dll(1): error C2018: unknown character '0x3'
1>C:\Windows\SysWOW64\user32.dll(1): error C2018: unknown character '0x4'
1>C:\Windows\SysWOW64\user32.dll(1): error C2018: unknown character '0x40'
1>C:\Windows\SysWOW64\user32.dll(1): error C2146: syntax error : missing ';' before identifier 'ÿÿ¸'
1>C:\Windows\SysWOW64\user32.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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆