Problem :
I am facing below error:
Severity Code Description Project File Line Error LNK2019 unresolved external symbol _main referenced in function "int __cdecl imyNVoke_main(void)" (?imyNVoke_main@@YAHXZ) Severity Code Description Project File Line Error LNK1120 1 unresolved externals
Following is my code:
#include "windows.h"
#include "tchar.h"
#include "d3d9.h"
#pragma comment(lib, "d3d9.lib")
LPDIRECT3D9 pDirect3D=NULL;
LPDIRECT3DDEVICE9 pDirect3DDevice=NULL;
const int mysegment = 50;
const int myNV = mysegment*13;
struct CUSTOMVERTEX
{
float x, y, z, rhv;
DWORD color;
};
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHW|D3DFVF_DIFFUSE)
LPDIRECT3DVERTEXBUFFER9 pVertexBuffer=NULL;
HRESULT InitialDirect3D(HWND hvnd)
{
if((pDirect3D=Direct3DCreate9(D3D_SDK_VERSION))==NULL)
return E_FAIL;
D3DDISPLAYMODE Display;
if(FAILED(pDirect3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &Display)))
return E_FAIL;
D3DPRESENT_PARAMETERS Direct3DParameter;
ZeroMemory(&Direct3DParameter, sizeof Direct3DParameter);
Direct3DParameter.Windowed=TRUE;
Direct3DParameter.SwapEffect=D3DSWAPEFFECT_DISCARD;
Direct3DParameter.BackBufferFormat=Display.Format;
if(FAILED(pDirect3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hvnd,
D3DCREATE_HARDWARE_VERTEXPROCESSING,
&Direct3DParameter, &pDirect3DDevice)))
return E_FAIL;
return S_OK;
}
HRE