Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am running the following code on my Windows10 machine with API version 1.19 of Intel Media SDK.
C++
#include<stdio.h>
#include"mfxvideo++.h"

void main() {
    printf("this is a new program using intel media sdk");

    mfxSession SWsess;
    mfxVersion SWver = {0,1}, ver;
    mfxStatus sts;

    sts = MFXInit(MFX_IMPL_SOFTWARE, &SWver, &SWsess);
 
    if (MFX_ERR_NONE == sts) {
        MFXQueryVersion(SWsess, &ver);
        printf("Implementation version: %d.%d and API version: %d.%d", SWver.Major, SWver.Minor, ver.Major, ver.Minor);
    }
 
    MFXClose(SWsess);
 
    getchar();
}
I made the project in Visual Studio 2015 but received following errors

Severity Error Code
Description
Project
File path
Program Line

The errors have been written in above format.

Error LNK1120
2 unresolved externals
ScreenCapture
~\Visual Studio\ScreenCapture\x64\Debug\ScreenCapture.exe
1

Error LNK2019
unresolved external symbol __imp_printf referenced in function main
ScreenCapture
~\Visual Studio\ScreenCapture\ScreenCapture\main.obj
1

Error LNK2019
unresolved external symbol swscanf_s referenced in function "private: bool __cdecl MFX::MFXPluginsInFS::ParseKVPair(wchar_t *,wchar_t *,class MFX::PluginDescriptionRecord &)" (?ParseKVPair@MFXPluginsInFS@MFX@@AEAA_NPEA_W0AEAVPluginDescriptionRecord@2@@Z)
ScreenCapture
~\Visual Studio\ScreenCapture\ScreenCapture\libmfx.lib(mfx_plugin_hive.obj)
1

Warning LNK4098
defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
ScreenCapture
~\Visual Studio\ScreenCapture\ScreenCapture\LINK
1

However, in Visual Studio 2012 the aforementioned code runs fine. Please advise what should I do to upgrade my project to Visual Studio 2015?

What I have tried:

I faced LNK2019 in Visual Studio 2017RC (Refer here) so I rolled back to Visual Studio 2015 and 2012. Solutions available for the errors on this or other forums are not working for me. For warning LNK4098, I couldn't conclude which libraries to ignore.
Posted
Updated 1-Feb-17 7:42am
v2

1 solution

LNK4098 means that there is a mismatch between versions of LIBC expected by various components of your program. It typically occurs when one static library is compiled against the static LIBC, and another library (or the main program) is compiled against the DLL version.

In order to fix this, look at the configuration for your main program, and for each library/DLL in your solution. They should all link against the same libraries (either all DLL, or all static). If you have a library only in binary form, its documentation should tell you which version of the library it requires.

Once you have sorted this out, all other problems should sort themselves out as well.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900