简体   繁体   English

我在哪里可以找到'winmm.lib'(我正在使用Visual Studio 2012)

[英]Where can I find 'winmm.lib' (I'm using Visual Studio 2012)

My OS is 64Bit Windows 7. 我的操作系统是64位Windows 7。
I wanted to build the DirectX Sample in C:\\Program Files (x86)\\Microsoft DirectX SDK (June 2010)\\Samples\\C++\\Direct3D10\\Tutorials\\Tutorial02. 我想在C:\\ Program Files(x86)\\ Microsoft DirectX SDK(2010年6月)\\ Samples \\ C ++ \\ Direct3D10 \\ Tutorials \\ Tutorial02中构建DirectX示例。 but when I build error occured with fatal error 但是当我构建错误时发生致命错误

LNK1104: 'winmm.lib' can't open the file. LNK1104:'winmm.lib'无法打开文件。

I reinstalled Direct SDK, but no change. 我重新安装了Direct SDK,但没有改变。 I also added the path (include, lib) to the settings. 我还在路径中添加了路径(include,lib)。

If I remove 'winmm.lib' from the project settings, 'comctl32.lib' can't be opened. 如果我从项目设置中删除“winmm.lib”,则无法打开“comctl32.lib”。 both libs were already present in properties>Linker>Input. 两个库已经存在于属性>链接器>输入中。

How can I solve this problem? 我怎么解决这个问题?

winmm.lib isn't part of the DirectX SDK but is part of the Windows SDK . winmm.lib不是DirectX SDK的一部分,但是是Windows SDK的一部分。

Latest Windows SDK versions were also heavily reorganized but it includes the library you're looking for. 最新的Windows SDK版本也进行了大量重组,但它包括您正在寻找的库。

只需将下面的行放在stdafx.h中

#pragma comment(lib, "winmm.lib")

If you are trying to build any of the legacy DirectX SDK samples with VS 2012 or VS 2013, you need to modify the include/libs paths per the instructions on bottom of the page on MSDN . 如果您尝试使用VS 2012或VS 2013构建任何旧版DirectX SDK示例,则需要根据MSDN上页面底部的说明修改include / libs路径。 The most important change is that you must reverse the Include/Lib path order: 最重要的变化是您必须反转Include / Lib路径顺序:

For VS 2010 it was: 对于VS 2010,它是:

$(DXSDK_DIR)Include;$(IncludePath)

$(DXSDK_DIR)Lib\\x86;$(LibraryPath) or $(DXSDK_DIR)Lib\\x64;$(LibraryPath) $(DXSDK_DIR)Lib\\x86;$(LibraryPath)$(DXSDK_DIR)Lib\\x64;$(LibraryPath)

For VS 2012/2013 it has to be: 对于VS 2012/2013,它必须是:

$(IncludePath);$(DXSDK_DIR)Include

$(LibraryPath);$(DXSDK_DIR)Lib\\x86 or $(LibraryPath);$(DXSDK_DIR)Lib\\x64 $(LibraryPath);$(DXSDK_DIR)Lib\\x86$(LibraryPath);$(DXSDK_DIR)Lib\\x64

Of course a better option is not spend time learning the older Direct3D 10 API at all, and use the latest Direct3D 11 Win32 desktop tutorials on MSDN Code Gallery . 当然,更好的选择是不花时间学习旧的Direct3D 10 API,并在MSDN Code Gallery上使用最新的Direct3D 11 Win32桌面教程。 In fact, I've posted many of the legacy DirectX SDK samples there so they work fine with VS 2012/2013 Express for Windows Desktop and VS 2012/2013 Pro+ as-is without the DirectX SDK at all. 事实上,我已经发布了许多遗留的DirectX SDK示例,因此它们可以在VS 2012/2013 Express for Windows Desktop和VS 2012/2013 Pro + as-is中完美地工作,而不需要DirectX SDK。

Read these blog posts: 阅读这些博文:

DirectX SDK Samples Catalog DirectX SDK样本目录

DirectX SDK Tools Catalog DirectX SDK工具目录

Living without D3DX 没有D3DX的生活

DirectX SDKs of a certain age 一定年龄的DirectX SDK

And review these CodePlex projects: 并查看这些CodePlex项目:

DirectX Tool Kit DirectX工具包

DirectXMesh DirectXMesh

DirectXTex DirectXTex

DXUT for Direct3D 11 DX3 for Direct3D 11

Effects 11 效果11

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM