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_AppError 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_AppError 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_AppError 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_AppError 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_AppError 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_AppError 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_AppError 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_AppError 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_AppError 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_AppError 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
Thx,
MikeH
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 NorrisThe 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_IFileDialogControlEvents1>nafxcwd.lib(dlgfile.obj) : error LNK2001: unresolved external symbol _IID_IFileDialogEvents1>nafxcwd.lib(dlgfile.obj) : error LNK2001: unresolved external symbol _CLSID_FileSaveDialog1>nafxcwd.lib(dlgfile.obj) : error LNK2001: unresolved external symbol _CLSID_FileOpenDialog1>nafxcwd.lib(dlgfile.obj) : error LNK2001: unresolved external symbol _IID_IPropertyStore1>nafxcwd.lib(dlgfile.obj) : error LNK2001: unresolved external symbol _IID_IShellItem21>nafxcwd.lib(afxdatarecovery.obj) : error LNK2001: unresolved external symbol _FOLDERID_LocalAppData1>nafxcwd.lib(doccore.obj) : error LNK2001: unresolved external symbol _IID_IPreviewHandlerVisuals1>nafxcwd.lib(doccore.obj) : error LNK2001: unresolved external symbol _IID_IPreviewHandler1>nafxcwd.lib(doccore.obj) : error LNK2001: unresolved external symbol _IID_IInitializeWithStream1>.\Debug\MSP430 HID API Demo App.exe : fatal error LNK1120: 10 unresolved externals1>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.
_____________________________________Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.
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.