[英]Qt library linking error
I have this headers in my class 我班上有这个头
#include <windows.h>
#include <mmreg.h>
#include <msacm.h>
#include <wmsdk.h>
#pragma comment(lib, "msacm32.lib")
#pragma comment(lib, "wmvcore.lib")
#pragma comment(lib, "winmm.lib")
#pragma intrinsic(memset,memcpy,memcmp)
When i try to use the function CreateStreamOnHGlobal(mp3HGlobal, FALSE, &mp3Stream);
当我尝试使用功能
CreateStreamOnHGlobal(mp3HGlobal, FALSE, &mp3Stream);
i get this error: 我收到此错误:
playlist.obj:-1: error: LNK2019: unresolved external symbol __imp__CreateStreamOnHGlobal@12 referenced in function "public: int __thiscall Playlist::getLengthInSeconds(class QString)" (?getLengthInSeconds@Playlist@@QAEHVQString@@@Z)
I've tried to add the msacm32.lib
but I found that exist under the name MSAcm32.lib
and Qt doesn't recognize it; 我曾尝试添加
msacm32.lib
但发现它以MSAcm32.lib
的名称存在,而Qt无法识别它。 also with winmm.lib
, who has the name WinMM.lib
. 还有
winmm.lib
,名字为WinMM.lib
。 I don't know what to add, what to do so that my program to work. 我不知道要添加什么,要做什么才能使我的程序正常工作。 What can i do?
我能做什么?
If by 如果通过
Qt doesn't recognize it
Qt无法识别
you mean that the linker error is not resolved, the following may help. 您的意思是链接器错误未解决,以下内容可能会有所帮助。
According to http://msdn.microsoft.com/en-us/library/windows/desktop/aa378980(v=vs.85).aspx you should also be linking to Ole32.lib
for CreateStreamOnHGlobal
. 根据http://msdn.microsoft.com/en-us/library/windows/desktop/aa378980(v=vs.85).aspx,您还应该链接到
CreateStreamOnHGlobal
Ole32.lib
。 If after adding ole32.lib other linker errors occur, a quick google or MSDN search will show you which lib files are missing. 如果在添加ole32.lib后出现其他链接器错误,快速的Google或MSDN搜索将向您显示缺少哪些lib文件。
Also, FYI windows is not case-sensitive. 同样,FYI窗口也不区分大小写。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.