Inclusion of dshow.h results in definition errors

后端 未结 2 1646
我寻月下人不归
我寻月下人不归 2021-01-25 20:12

I am trying to do a few things using DirectShow for audio playback. I have a header file, at the top is:

#pragma once
#include 
#pragma comment(lib         


        
相关标签:
2条回答
  • 2021-01-25 20:24

    Fixed this by changing the order of the #include definitions. I moved the header file that the above code was defined in to the top and it works ok now. Must have been a clash with some code in another file, possibly some directSound related stuff.

    0 讨论(0)
  • 2021-01-25 20:44

    I have faced this SDK integration error a couple times, most recently when integrating a win32 console app with a library that uses Windows CoreAudio and the error occurred with a stdafx.h:

    // stdafx.h : include file for standard system include files,
    // or project specific include files that are used frequently, but
    // are changed infrequently
    //
    
    #pragma once
    
    #ifndef _WIN32_WINNT        // Allow use of features specific to Windows XP or later.                   
    #define _WIN32_WINNT 0x0502 // Change this to the appropriate value to target other versions of Windows.
    #endif                      
    
    #include <stdio.h>
    #include <tchar.h>
    
    
    
    // TODO: reference additional headers your program requires here
    #include <afx.h>
    #include <afxwin.h>
    

    Then to resolve the error, I added the following below the current includes:

    #include <winioctl.h>
    #if (MSC_VER < 1400)
    #include <strmif.h>
    #endif
    

    Hopefully this will help someone in the future facing this issue. EB

    0 讨论(0)
提交回复
热议问题