Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

libmfx.lib with STL on Windows

Ashim_Prasad
Beginner
1,054 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
1,054 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

0 Kudos
4 Replies
Harshdeep_B_Intel
1,054 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, 

0 Kudos
Harshdeep_B_Intel
1,055 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,

0 Kudos
Ashim_Prasad
Beginner
1,054 Views

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

0 Kudos
Harshdeep_B_Intel
1,054 Views

Glad, resolved the issue. Closing this thread. 

0 Kudos
Reply