I am trying to create message Queue in window but i am getting following linker error.
Sample Code:
#include "stdafx.h"
#include "windows.h"
#include "mq.h"
#include "tchar.h"
int _tmain(int argc, _TCHAR* argv[])
{
wchar_t name[]=L".\\PRIVATE$\\VinayQueue21";
DWORD bufferLength = 256;
wchar_t formattedQueueName[256];
HRESULT returnValue = MQCreateQueue(name, NULL,formattedQueueName,&bufferLength);
if(returnValue != MQ_OK)
{
wprintf(L"Creating a Queue failed\n");
}
else
{
wprintf(L"Queue was successfully created..Formatted QueueName =%s\n",formattedQueueName);
wprintf(L"LEn returned is %d\n", bufferLength);
}
getchar();
return 0;
}
Error:
error1 LNK2019: unresolved external symbol _MQCreateQueue@16 referenced
error2 LNK1120: 1 unresolved externals
How to resolve this?