Question

I created an empty c++ console application with visual studio 2010 and dragged and dropped the source files from http://blogs.msdn.com/b/matthew_van_eerde/archive/2008/12/16/sample-wasapi-loopback-capture-record-what-you-hear.aspx but when I click on rebuild I get a load of errors which dont direct me anywhere in the source... The executable provided with the source works fine So can you please check it out and tell me what am I missing.

update:

Error   1   error LNK2001: unresolved external symbol _AvRevertMmThreadCharacteristics@4    c:\Users\Admin\documents\visual studio 2010\Projects\tr\tr\loopback-capture.obj tr

Error   2   error LNK2001: unresolved external symbol __imp__mmioWrite@12   c:\Users\Admin\documents\visual studio 2010\Projects\tr\tr\loopback-capture.obj tr

Error   3   error LNK2001: unresolved external symbol __imp__mmioCreateChunk@12 c:\Users\Admin\documents\visual studio 2010\Projects\tr\tr\loopback-capture.obj tr

Error   4   error LNK2001: unresolved external symbol __imp__mmioAscend@12  c:\Users\Admin\documents\visual studio 2010\Projects\tr\tr\loopback-capture.obj tr

Error   5   error LNK2001: unresolved external symbol _AvSetMmThreadCharacteristicsW@8  c:\Users\Admin\documents\visual studio 2010\Projects\tr\tr\loopback-capture.obj tr

Error   6   error LNK2001: unresolved external symbol __imp__mmioOpenW@12   c:\Users\Admin\documents\visual studio 2010\Projects\tr\tr\main.obj tr

Error   7   error LNK2001: unresolved external symbol __imp__mmioClose@8    c:\Users\Admin\documents\visual studio 2010\Projects\tr\tr\main.obj tr

Error   8   error LNK2001: unresolved external symbol __imp__mmioDescend@16 c:\Users\Admin\documents\visual studio 2010\Projects\tr\tr\main.obj tr

Error   9   error LNK1120: 8 unresolved externals   c:\users\admin\documents\visual studio 2010\Projects\tr\Release\tr.exe  tr
Was it helpful?

Solution

Well if you check in your source folder, you'll see that there are a few libraries that must be linked to:

TARGETLIBS = \
    $(SDK_LIB_PATH)\avrt.lib \
    $(SDK_LIB_PATH)\ole32.lib \
    $(SDK_LIB_PATH)\winmm.lib \

In this particular case, you will want to go into your VS2010 settings for the project you've created and include these files. I believe the option will fall under Additional Dependencies, although I don't have VS2010 handy to double check.

I believe in the neighborhood of Properties > C++ > Linker > Additional Dependencies

That may not be exact, but it should get you close to where you need to be. You'll need to include avrt.lib, ole32.lib, winmm.lib.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top