See my answer to your question here: http://social.msdn.microsoft.com/Forums/vstudio/en-US/b80068ac-e17b-4f21-85fd-1d87fdc9b6b6/link-error-when-using-the-cpuid-in-intrinh?forum=msbuild
Link error when using the __cpuid() in <intrin.h>?
-
04-07-2023 - |
質問
The error says:
error LNK2019: unresolved external symbol WinCPUID_Init referenced in function
"public: static void __cdecl CCapturer::GetCPUVendorId(void)"
(?GetCPUVendorId@CCapturer@@SAXXZ)
but it doesn't point out which lib I should add in MSDN _cpuid
How to solve it ?
解決
他のヒント
Apparently it was also used by the fddshow-tryout installer (I don't know what that is) and is defined in WinCPUID.dll
external 'WinCPUID_Init@files:WinCPUID.dll cdecl';
I found a match for WinCPUID_Init symbol here:
http://code.google.com/p/notepad2-mod/source/browse/branches/inno/distrib/cpu_detection.iss?r=616
The code header says
// The script is taken from the ffdshow-tryouts installer
// http://sourceforge.net/projects/ffdshow-tryout/
And later
// functions to detect CPU
function WinCPUID_Init(msGetFrequency: Integer; var pInfo: TCPUInfo): Integer;
external 'WinCPUID_Init@files:WinCPUID.dll cdecl';
// function to get system information
procedure GetSystemInfo(var lpSystemInfo: TSystemInfo); external 'GetSystemInfo@kernel32.dll stdcall';
procedure CPUCheck();
var
CPUInfo: TCPUInfo;
begin
WinCPUID_Init(0, CPUInfo);
if (CPUInfo.bIsInitialized = 0) then begin
// something went wrong
end
else begin
if (CPUInfo.bSSE_Supported = 1) then begin
cpu_sse := true;
end;
if (CPUInfo.bSSE2_Supported = 1) then begin
cpu_sse2 := true;
end;
end;
end;
所属していません StackOverflow