0

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 ?

A B
  • 1,461
  • 2
  • 19
  • 54
  • Please show declaration and Call of `CCapturer::GetCPUVendorId` – A B Apr 16 '14 at 08:59
  • declaration public: static void GetCPUVendorId(); definition void CCapturer::GetCPUVendorId(){...};call CCapturer::GetCPUVendorId() – christopher Apr 16 '14 at 09:26
  • this is a definition of function i think the problem is in the calling can u please show that? – A B Apr 16 '14 at 09:27
  • @christopher please, please, don't post additional information to your question in comments, put them in question itself. It is nor readable, nor helpful to anyone. – zoska Apr 16 '14 at 09:37

2 Answers2

0

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;
amdn
  • 11,314
  • 33
  • 45