2014-04-16 56 views
-1

錯誤說:使用<intrin.h>中的__cpuid()時出現鏈接錯誤?

error LNK2019: unresolved external symbol WinCPUID_Init referenced in function 
"public: static void __cdecl CCapturer::GetCPUVendorId(void)" 
([email protected]@@SAXXZ) 

,但它並沒有指出我應該在MSDN _cpuid

添加哪些LIB如何解決呢?

+0

請出示的'CCapturer :: GetCPUVendorId' –

+0

聲明公開聲明和呼叫:靜態無效GetCPUVendorId();定義void CCapturer :: GetCPUVendorId(){...};調用CCapturer :: GetCPUVendorId() – christopher

+0

這是一個函數的定義我認爲問題是在調用中可以ü請顯示? –

回答

0

顯然它也使用fddshow,試用安裝程序(我不知道那是什麼),並在WinCPUID.dll

external  '[email protected]:WinCPUID.dll cdecl'; 

定義我發現WinCPUID_Init符號匹配的位置:

http://code.google.com/p/notepad2-mod/source/browse/branches/inno/distrib/cpu_detection.iss?r=616

代碼頭說

// The script is taken from the ffdshow-tryouts installer 
// http://sourceforge.net/projects/ffdshow-tryout/ 

後來

// functions to detect CPU 
function WinCPUID_Init(msGetFrequency: Integer; var pInfo: TCPUInfo): Integer; 
external  '[email protected]:WinCPUID.dll cdecl'; 
// function to get system information 
procedure GetSystemInfo(var lpSystemInfo: TSystemInfo); external '[email protected] 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; 
相關問題