This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430 HID_Demo_App linker errors

Guru 15580 points

I am trying to build the  MSP430 USB HID Application using VS2010. I have downloaded and installed the latest WDK (7.1) and added the links to c:\<WinDDK Install>\<Build Version>\inc\api\  and c:\<WinDDK Install>\<Build Version>\inc\crt\  . I have also added a link to c:\<WinDDK Install>\<Build Version>\lib\wxp\i386 in the linker properties. However, I get the following linker errors. Can someone offer suggest on how to get rid of these?

Error	5	error LNK2001: unresolved external symbol _IID_IFileDialogControlEvents	C:\Users\Mike\Documents\Visual Studio 2010\Projects\MSP430 Windows HID API\Source Code\nafxcwd.lib(dlgfile.obj)	HID_Demo_App
Error 6 error LNK2001: unresolved external symbol _IID_IFileDialogEvents C:\Users\Mike\Documents\Visual Studio 2010\Projects\MSP430 Windows HID API\Source Code\nafxcwd.lib(dlgfile.obj) HID_Demo_App
Error 7 error LNK2001: unresolved external symbol _CLSID_FileSaveDialog C:\Users\Mike\Documents\Visual Studio 2010\Projects\MSP430 Windows HID API\Source Code\nafxcwd.lib(dlgfile.obj) HID_Demo_App
Error 8 error LNK2001: unresolved external symbol _CLSID_FileOpenDialog C:\Users\Mike\Documents\Visual Studio 2010\Projects\MSP430 Windows HID API\Source Code\nafxcwd.lib(dlgfile.obj) HID_Demo_App
Error 9 error LNK2001: unresolved external symbol _IID_IPropertyStore C:\Users\Mike\Documents\Visual Studio 2010\Projects\MSP430 Windows HID API\Source Code\nafxcwd.lib(dlgfile.obj) HID_Demo_App
Error 10 error LNK2001: unresolved external symbol _IID_IShellItem2 C:\Users\Mike\Documents\Visual Studio 2010\Projects\MSP430 Windows HID API\Source Code\nafxcwd.lib(dlgfile.obj) HID_Demo_App
Error 11 error LNK2001: unresolved external symbol _FOLDERID_LocalAppData C:\Users\Mike\Documents\Visual Studio 2010\Projects\MSP430 Windows HID API\Source Code\nafxcwd.lib(afxdatarecovery.obj) HID_Demo_App
Error 12 error LNK2001: unresolved external symbol _IID_IPreviewHandlerVisuals C:\Users\Mike\Documents\Visual Studio 2010\Projects\MSP430 Windows HID API\Source Code\nafxcwd.lib(doccore.obj) HID_Demo_App
Error 13 error LNK2001: unresolved external symbol _IID_IPreviewHandler C:\Users\Mike\Documents\Visual Studio 2010\Projects\MSP430 Windows HID API\Source Code\nafxcwd.lib(doccore.obj) HID_Demo_App
Error 14 error LNK2001: unresolved external symbol _IID_IInitializeWithStream C:\Users\Mike\Documents\Visual Studio 2010\Projects\MSP430 Windows HID API\Source Code\nafxcwd.lib(doccore.obj) HID_Demo_App
Error 15 error LNK1120: 10 unresolved externals C:\Users\Mike\Documents\Visual Studio 2010\Projects\MSP430 Windows HID API\Source Code\Debug\MSP430 HID API Demo App.exe 1 1 HID_Demo_App

  • I am seeing this problem too.  Not in the TI example, but my own executable which linked to the TI HID sources.  There are many links on Google that describe this issue in VS2010 for non-TI code.

    My build machine uses VS2010 SP1 and the WinDDK 7600.16385.1.  I found the problem when I linked to MFC statically instead of dynamically.

    The missing functions seem to be contained in uuid.lib

    The action that fixed it for me was to go to my project properties, open Configuration Properties, open Linker, select Input, then add this file into the Additional Dependencies:
    C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\uuid.lib

    Searching on Google, other people are linking uuid.lib from different locations.  I'm not sure which uuid.lib is preferred, but the above one worked for me.  There is some mystery in linking to Microsoft's libs, especially when multiple SDK versions are installed on the same PC.

    Good luck, and let me know how you solved it for your situation!

    Regards,

    Chris Norris

  • Chris,

    Chris Norris said:
    The missing functions seem to be contained in uuid.lib

    Adding this .lib to my linker solved the build problem. Thanks! However, now I am getting errors when I start debugging ("the parameter is incorrect"), and an exception is thrown when I enter the VID/PID for my device(Unhandled exception at 0x75ffb9bc in HID_Demo_App.exe: Microsoft C++ exception: COleException at memory location 0x02dcdcd4..). 

    Is anyone at TI supporting this application?

  • I am having a similar problem, but the fix proposed by Chris didn't help. Here are the complaints from Visual Studio:

    1>nafxcwd.lib(dlgfile.obj) : error LNK2001: unresolved external symbol _IID_IFileDialogControlEvents
    1>nafxcwd.lib(dlgfile.obj) : error LNK2001: unresolved external symbol _IID_IFileDialogEvents
    1>nafxcwd.lib(dlgfile.obj) : error LNK2001: unresolved external symbol _CLSID_FileSaveDialog
    1>nafxcwd.lib(dlgfile.obj) : error LNK2001: unresolved external symbol _CLSID_FileOpenDialog
    1>nafxcwd.lib(dlgfile.obj) : error LNK2001: unresolved external symbol _IID_IPropertyStore
    1>nafxcwd.lib(dlgfile.obj) : error LNK2001: unresolved external symbol _IID_IShellItem2
    1>nafxcwd.lib(afxdatarecovery.obj) : error LNK2001: unresolved external symbol _FOLDERID_LocalAppData
    1>nafxcwd.lib(doccore.obj) : error LNK2001: unresolved external symbol _IID_IPreviewHandlerVisuals
    1>nafxcwd.lib(doccore.obj) : error LNK2001: unresolved external symbol _IID_IPreviewHandler
    1>nafxcwd.lib(doccore.obj) : error LNK2001: unresolved external symbol _IID_IInitializeWithStream
    1>.\Debug\MSP430 HID API Demo App.exe : fatal error LNK1120: 10 unresolved externals
    1>
    1>Build FAILED.
    1>
    1>Time Elapsed 00:00:01.89
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Any ideas?

  • Again, unresolved external symbols mean that you forgot to include something into the list of objects to link.

    However, if using libraries which require other libraries, teh order in which you list them in the project settings is important. The library that has the requirement needs to be listed first, the library that fulfils the requirement needs to follow. So when the second library is checked, the requirements are known.
    If the linker does not find an open requirement when it checks a library, the library isn't linked, even if another library further down the list would require it. In case of circular references (e.g. a function an liba requires a function of libb whcih in turn requires a different function from liba), it might be even necessary to list the same library twice (a, b, a).

    This 'problem' does not apply to normal object files. Those are correctly linked in any order. It only applies to libraries.

  • I figured out the problem -- the readme file is incorrect if you are using a windows 7 machine. For a windows 7 machine, step 7 should be:

    7. Include:                                                              |
          a. c:\<WinDDK Install>\<Build Version>\lib\win7\i386

    Then after getting the project to compile, it had linker errors when I tried to run the program. I fixed this by changing the project name from "'HID_Demo_App'" to "MSP430 HID API Demo App".

    FYI -- I am also using MS Visual Studio 10, Professional Edition.

  • Chris -- did you find a solution to the "parameter is incorrect" the exception thrown for VID/PID? I am having the same problem.

  • Ben,

    The "Parameter is incorrect" was my problem, not Chris'. I haven't had time to chase this problem down.

    I also noticed you are using VS10 and Windows 7. Same here. Hopefully we can figure this out since TI apparently does not support this.

**Attention** This is a public forum