Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Chintan_M_
Beginner
61 Views

Error while executing a simple program using API 1.19

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
61 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-symbo...

 

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

Mark_L_Intel1
Moderator
61 Views

Yes, you have an environment issue.

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

Mark

Reply