我正在尝试使用C ++中的Visual Studio构建64位应用程序
我需要访问Windows目录中的Sens.dll
。由于Visual Studio是32位应用程序,因此我必须使用SysNative而不是System32
#import "C:/Windows/SysNative/Sens.dll"
由于文件系统重定向。
如果我将路径更改为C:/Windows/System32/Sens.dll
,Visual Studio将无法访问它,因为它在构建时会重定向到SysWOW64。为了减轻这种情况,我可以使用SysNative,但是所构建的可执行文件是64位应用程序,而SysNative无法访问。
有什么办法解决吗?
[SysNative的更好的解释是File System Redirector
不要使用这样的绝对路径导入
#import "C:/windows/system32/sens.dll"
仅在使用include
,using
或import
时才应使用相对路径。而是将路径添加到项目设置中的查找列表,然后仅将#import "sens.dll"
语法:
#import "filename" [attributes]
#import <filename> [attributes]
我们无法使用绝对路径直接导入。我建议您可以尝试使用以下步骤:
1,搜索代码库或c中存在sens.dll
的位置:
C:\ Windows \ System32
2,在步骤1中找到任何路径后,应将该路径添加到项目的其他库目录中。
右键单击项目>配置属性>链接器>常规>其他库目录。将路径添加到其他库目录