打个比方说,你在testDlg.cpp中需要用到mciSendString,那么就是
testDlg.cpp中
#include "stdafx.h"
->最好加上 #include <windows.h>
->加到这里 #include <mmsystem.h>
#include "testDlg.h"
....
如果有好几个cpp文件都要用到mciSendString,那就在这几个cpp文件中都加上。
至于winmm.lib,加到“工程设置->连接(Link)->输入->输入库”里面。
或者在cpp文件中加入
#pragma comment(lib, "winmm.lib") //加到#include的下面即可
记住一点,stdafx是预编译头,一般不要向这个里面添加其他内容。
打开VS2015安装目录中这个文件文件D:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\VCWizards\default.vcxproj,其实是个XML文件,在default.vcxproj文件末尾的</Project>之前填加下列内容,保存即可大功告成:<PropertyGroup>
<IncludePath>d:\boost_1_60_0$(IncludePath)</IncludePath>
<VC_LibraryPath_x86>d:\boost_1_60_0\VC2015_lib32$(VC_LibraryPath_x86)</VC_LibraryPath_x86>
<VC_LibraryPath_x64>d:\boost_1_60_0\VC2015_lib64$(VC_LibraryPath_x64)</VC_LibraryPath_x64>
</PropertyGroup>
其中d:\boost_1_60_0是boost库解压路径,该文件夹下面有boost文件夹(是boost源文件)
d:\boost_1_60_0\VC2015_lib32是编译好的32位库目录
d:\boost_1_60_0\VC2015_lib64是编译好的64位库目录
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)