0
votes

I'm encountering a strange bug in Visual Studio 2010...

I work with the Kinect for Windows SDK v1.8 on VS 2010 Ultimate, for a speech recognizer program using the MS Kinect.

Like it's explained in the sample SpeechBasics (available on Kinect Developer Toolkit Browser), I added the specifics VC++ include and library paths into my project properties, before listing the default system include and library directories.

But When I buid the solution, I get the following errors :

CKinect_Squeletton.obj: error LNK2001: unresolved external symbol _SPDFID_WaveFormatEx CKinect_Squeletton.obj: error LNK2001: unresolved external symbol _CLSID_SpStream CKinect_Squeletton.obj: error LNK2001: unresolved external symbol _CLSID_SpInprocRecognizer CKinect_Squeletton.obj: error LNK2001: unresolved external symbol _CLSID_SpObjectTokenCategory

build failed.

I had checked all my include files, all my project properties. I did a lot of research, and tested many possibilities of response, but I hadn't found response for my problem...

I have tried cleaning the solution, build with a x64 target architecture, but that doesn't always work.

  • Why have I this problem ?
2
Project + Properties, Linker, Input. You need to add sapi.lib to the Additional Dependencies setting. Or use #pragma comment(lib, "sapi.lib") in your source code.Hans Passant

2 Answers

0
votes

Like suggested in the comment, I've checked the link on social MSDN

I've resolved some errors but not all in using __uuidof(SpStream) instead of CLSID_SpStream , and __uuidof(SpInprocRecognizer) instead of CLSID_SpInprocRecognizer .

But i don't found CLSID_SpObjectTokenCategory in my code, I have only

ISpObjectToken *pEngineToken = NULL;
hr = SpFindBestToken(SPCAT_RECOGNIZERS,L"Language=40C;Kinect=True",NULL,&pEngineToken);

I can't replace it with __uuidof(SpObjectTokenCategory) .

Also, I always don't know how to resolve the error

CKinect_Squeletton.obj: error LNK2001: unresolved external symbol _SPDFID_WaveFormatEx

I've added sapi.lib in Project + Properties, Linker, Input, and I also try with #pragma comment(lib, "sapi.lib")

0
votes

I have resolved my problem !

I work on Windows 7 64bit, and I had installed MS Speech Platform SDK 11 x64.

But to build with a x86 target architecture , I had to install and use MS Speech Platform SDK 11 x86, and specify in my project properties the path for the x86 sapi lib !

The compiler gave me errors when I've tried to build with a x64 target architecture, because others specific libraries that I have included in the project are for a x86 architecture...

Sorry and maybe this solution will help someone one day !