Media (Intel® oneAPI Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools from Intel. This includes Intel® oneAPI Video Processing Library and Intel® Media SDK.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

libmfx.lib with STL on Windows

Ashim_Prasad
Beginner
570 Views

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
Harshdeep_B_Intel
570 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
Harshdeep_B_Intel
570 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, 

Harshdeep_B_Intel
571 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,

Ashim_Prasad
Beginner
570 Views

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

Harshdeep_B_Intel
570 Views

Glad, resolved the issue. Closing this thread. 

Reply