Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Ashim_Prasad
Beginner
342 Views

libmfx.lib with STL on Windows

Jump to solution

Hello,

I am not able to link my program which uses media sdk and STL together on windows. I am using visual studio 2015. I am able to link only if I specify /MT instead of /MD, however I need to specify /MD since /MT is not compatible "Consume windows run-time library" - that I need to enable.

A small sample code like below gives error "error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease". Note that this error goes away if I remove either usage of STL (string) or mfx. Also this goes away if I use /MT switch - but I can't

#include <stdio.h>
#include <string>
#include <mfxvideo.h>

using std::string;


int main()
{
    string test("hello");
    printf("%s\n", test.c_str());

    mfxIMPL impl = MFX_IMPL_AUTO;
     mfxVersion ver = { { 0, 1 } };
    mfxSession session;
    mfxStatus status = MFXInit(impl, &ver, &session);

    return 0;
}

0 Kudos
1 Solution
342 Views

Hi Ashim, 

If you need to use /MD setting in you app build, you will need to rebuild dispatcher from source with /MD option and use it instead of dispatcher version provided in release package (which is built with /MT). Source code to dispatcher lib is available at MediaSDK installed directory (<\opensource\mfx_dispatch>\). Using the same setting in dispatcher and app will work. 

Thanks,

View solution in original post

4 Replies
342 Views

Hi Ashim, 

MediaSDK DLL libraries are updated with every driver release. Let me check with our team on your use case usage and get back to you soon.  

Thanks, 

343 Views

Hi Ashim, 

If you need to use /MD setting in you app build, you will need to rebuild dispatcher from source with /MD option and use it instead of dispatcher version provided in release package (which is built with /MT). Source code to dispatcher lib is available at MediaSDK installed directory (<\opensource\mfx_dispatch>\). Using the same setting in dispatcher and app will work. 

Thanks,

View solution in original post

Ashim_Prasad
Beginner
342 Views

Thanks. Building the library from the opensource directory has solved the problem

342 Views

Glad, resolved the issue. Closing this thread. 

Reply