2012-09-17 6 views
3

Je tente d'utiliser GetProcessImageFileName. J'ai inclus Psapi.h mais lorsque je tente ti compiler je reçoisGetProcessImageFileName ne pas lier

error LNK2019: unresolved external symbol [email protected] referenced in function "bool __cdecl FindProcesses(char const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)" ([email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z)99>G:\Test\main\Tests.exe : fatal error LNK1120: 1 unresolved externals 

La fonction est en Itellisense si quelqu'un peut me dire pourquoi il compile l'habitude?

Répondre

4

Il s'agit d'un échec de l'éditeur de liens (il compile) et n'est pas lié à l'inclusion de Psapi.h. Vous probablement besoin de lier avec Psapi.lib.

Pour obtenir des instructions spécifiques sur ce lien avec la bibliothèque pour voir la bibliothèque section de la page de référence GetProcessImageFileName():

 
Kernel32.lib on Windows 7 and Windows Server 2008 R2; 
Psapi.lib (if PSAPI_VERSION=1) on Windows 7 and Windows Server 2008 R2; 
Psapi.lib on Windows Server 2008, Windows Vista, Windows Server 2003, 
and Windows XP