Domanda

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 ?

Altri suggerimenti

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;
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top