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.

Error while executing a simple program using API 1.19

Chintan_M_
Beginner
424 Views

I am getting following error while writing the program given below. Please help me identify the problem.

Severity    Code    Description    Project    File    Line    Suppression State
Error    LNK2019    unresolved external symbol _MFXInit referenced in function _main    HelloWorld_Intel_SDK    *\Visual Studio\Projects\HelloWorld_Intel_SDK\HelloWorld_Intel_SDK\Source.obj    1    
Error    LNK2019    unresolved external symbol _MFXClose referenced in function _main    HelloWorld_Intel_SDK    *\Visual Studio\Projects\HelloWorld_Intel_SDK\HelloWorld_Intel_SDK\Source.obj    1    
Error    LNK2019    unresolved external symbol _MFXQueryVersion referenced in function _main    HelloWorld_Intel_SDK    *\Visual Studio\Projects\HelloWorld_Intel_SDK\HelloWorld_Intel_SDK\Source.obj    1    
Error    LNK1120    3 unresolved externals    HelloWorld_Intel_SDK    *\Visual Studio\Projects\HelloWorld_Intel_SDK\Debug\HelloWorld_Intel_SDK.exe    1    

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

int main() {
	mfxVersion SWversion = { 0,1 }, HWversion = { 0,1 }, version;
	
	mfxSession SWsession, HWsession;
	
	mfxStatus sts;

	sts = MFXInit(MFX_IMPL_SOFTWARE, &SWversion, &SWsession);

	if (MFX_ERR_NONE == sts)
	{
		MFXQueryVersion(SWsession, &version);
		printf("For Software implementation\nSW version: %d.%d \n API level: %d.%d\n\n\n",
			SWversion.Major, SWversion.Minor, version.Major, version.Minor);
	}

	sts = MFXInit(MFX_IMPL_HARDWARE, &HWversion, &HWsession);

	if (MFX_ERR_NONE == sts)
	{
		MFXQueryVersion(HWsession, &version);
		printf("For Hardware implementation\nSW version: %d.%d \n API level: %d.%d\n\n\n",
			HWversion.Major, HWversion.Minor, version.Major, version.Minor);
	}

	MFXClose(SWsession);
	MFXClose(HWsession);
}

 

0 Kudos
2 Replies
Chintan_M_
Beginner
424 Views

[for VS2015] To solve this issue make sure to include all the dependencies by right-clicking on the Project in the property.

If you are still stuck then read this https://www.codeproject.com/Questions/1163428/Error-LNK-using-visual-studio-RC or http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix

 

If these answers don't help then leave a message here.

0 Kudos
Mark_L_Intel1
Moderator
424 Views

Yes, you have an environment issue.

property->linker and make sure "libmfx.lib" is in the linking command line.

Mark

0 Kudos
Reply