How to fix a linker error with PKEY_Device_FriendlyName

This is a discussion on How to fix a linker error with PKEY_Device_FriendlyName within the C++ Programming forums, part of the General Programming Boards category; Upon using PKEY_Device_FriendlyName, I'm getting the following errors: Code: Error 1 error LNK2001: unresolved external symbol _PKEY_Device_FriendlyName DefaultAudioDeviceCPP.obj Error 2 ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    100

    How to fix a linker error with PKEY_Device_FriendlyName

    Upon using PKEY_Device_FriendlyName, I'm getting the following errors:

    Code:
    Error   1   error LNK2001: unresolved external symbol _PKEY_Device_FriendlyName DefaultAudioDeviceCPP.obj   
    Error   2   fatal error LNK1120: 1 unresolved externals C:\Users\srobertson\Documents\Visual Studio 2005\Projects\DefaultAudioDeviceCPP\Debug\DefaultAudioDeviceCPP.exe
    What's a very simple way to clear these errors? I'm including functiondiscovery.h and functiondiscoverykeys.h. Also the path in Project->Properties...->Configuration Properties->C/C++->General->Additional Include Directories is correct.

    EDIT: One thing of interest is that the errors are mentioning: _PKEY_Device_FriendlyName, not PKEY_Device_FriendlyName. But I'm only using the latter in my program.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,834
    PKEY_Device_FriendlyName
    Is your OS at least Vista?

    > Project->Properties...->Configuration Properties->C/C++->General->Additional Include Directories
    But there is also
    - additional library search directories
    - additional libraries.


    > EDIT: One thing of interest is that the errors are mentioning: _PKEY_Device_FriendlyName,
    A leading underscore is typically added by the compiler when it generates the code.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linker Error
    By tcpurvis in forum C Programming
    Replies: 8
    Last Post: 03-03-2011, 01:41 AM
  2. Linker Error
    By Bash in forum C++ Programming
    Replies: 13
    Last Post: 12-07-2007, 02:11 AM
  3. [Linker error]
    By Overlord in forum C++ Programming
    Replies: 3
    Last Post: 07-29-2006, 06:44 AM
  4. Linker Error
    By samGwilliam in forum C++ Programming
    Replies: 2
    Last Post: 03-17-2005, 10:01 PM
  5. Linker Error?
    By drdroid in forum C++ Programming
    Replies: 7
    Last Post: 02-25-2003, 07:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21