fatal error LNK1104: cannot open file 'd3dx10.lib'

Started by
0 comments, last by Kalten 13 years, 5 months ago
Hello ^_^


im learning Direct 3D

So ive been trying to make my own code and everything went great until i encountered this ''ungoogleable'' error



1>LINK : fatal error LNK1104: cannot open file 'd3dx10.lib'



Ive set'd additional library path and i also added this .lib in the additionals dependencies

Heres my code



//-------------------------------------------------------------------------------------------|

// Les Headers/Define/Else

//-------------------------------------------------------------------------------------------|

#include <windows.h>

#include <d3d11.h>

#include <d3dx10.h>

#include <d3dx11.h>

#include <d3dcompiler.h>

#include <xnamath.h>

//-------------------------------------------------------------------------------------------|

// Les Structs

//-------------------------------------------------------------------------------------------|

struct VERTEX {FLOAT X, Y, Z; D3DXCOLOR Color;};

//-------------------------------------------------------------------------------------------|

// Variables Globalle

//-------------------------------------------------------------------------------------------|

HINSTANCE g_hInst = NULL;

HWND g_hWnd = NULL;

D3D_DRIVER_TYPE g_driverType = D3D_DRIVER_TYPE_NULL;

D3D_FEATURE_LEVEL g_featureLevel = D3D_FEATURE_LEVEL_11_0;

ID3D11Device* g_pd3dDevice = NULL;

ID3D11DeviceContext* g_pImmediateContext = NULL;

IDXGISwapChain* g_pSwapChain = NULL;

ID3D11RenderTargetView* g_pRenderTargetView = NULL;

ID3D11VertexShader* g_pVertexShader = NULL;

ID3D11PixelShader* g_pPixelShader = NULL;

ID3D11InputLayout* g_pVertexLayout = NULL;

ID3D11Buffer* g_pVertexBuffer = NULL;

//-------------------------------------------------------------------------------------------|

// Declaration

//-------------------------------------------------------------------------------------------|

HRESULT InitWindow( HINSTANCE hInstance, int nCmdShow );

HRESULT InitDevice();

void CleanupDevice();

LRESULT CALLBACK WndProc( HWND, UINT, WPARAM, LPARAM );

void Render();

//-------------------------------------------------------------------------------------------|

// Idk lol

//-------------------------------------------------------------------------------------------|

int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow )

{

UNREFERENCED_PARAMETER( hPrevInstance );

UNREFERENCED_PARAMETER( lpCmdLine );

if( FAILED( InitWindow( hInstance, nCmdShow ) ) )

return 0;

if( FAILED( InitDevice() ) )

{

CleanupDevice();

return 0;

}

//-------------------------------------------------------------------------------------------|

// Peak msg Loop

//-------------------------------------------------------------------------------------------|

MSG msg = {0};

while( WM_QUIT != msg.message )

{

if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )

{

TranslateMessage( &msg );

DispatchMessage( &msg );

}

else

{

Render();

}

}

CleanupDevice();

return ( int )msg.wParam;

}

//-------------------------------------------------------------------------------------------|

// Initialisation de la window // Classe + Create

//-------------------------------------------------------------------------------------------|

HRESULT InitWindow( HINSTANCE hInstance, int nCmdShow )

{

//wc.style = CS_HREDRAW | CS_VREDRAW;

//wc.lpfnWndProc = WindowProc;

//wc.hInstance = hInstance;

//wc.hCursor = LoadCursor(NULL, IDC_ARROW);

//wc.hbrBackground = (HBRUSH)COLOR_WINDOW;

//wc.lpszClassName = L"Window Class Name";

WNDCLASSEX wcex;

wcex.cbSize = sizeof( WNDCLASSEX );

wcex.style = CS_HREDRAW | CS_VREDRAW;

wcex.lpfnWndProc = WndProc;

wcex.cbClsExtra = 0;

wcex.cbWndExtra = 0;

wcex.hInstance = hInstance;

wcex.hCursor = LoadCursor( NULL, IDC_ARROW );

wcex.hbrBackground = ( HBRUSH )( COLOR_WINDOW + 1 );

wcex.lpszMenuName = NULL;

wcex.lpszClassName = "WindowClass"; // <-------------------------------------

wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_APPLICATION));

if( !RegisterClassEx( &wcex ) )

return E_FAIL;


// Create

g_hInst = hInstance;

RECT rc = { 0, 0, 640, 480 };

AdjustWindowRect( &rc, WS_OVERLAPPEDWINDOW, FALSE );

g_hWnd = CreateWindow( "WindowClass", "NerKMinD",

WS_OVERLAPPEDWINDOW,

CW_USEDEFAULT, CW_USEDEFAULT, rc.right - rc.left, rc.bottom - rc.top, NULL, NULL, hInstance,

NULL );

if( !g_hWnd )

return E_FAIL;

ShowWindow( g_hWnd, nCmdShow );

return S_OK;

}
Advertisement
Error means the file can not be found or opened, meaning you've got an error in the path, or the file is otherwise locked, make sure its not tagged as read only and that the file security is such that you can open the file.

make sure in the project properties that the lib folder is referenced to the x86 or the x64 folders within the lib folder in the DirectX SDK folder, if you dont be explicit it wont work.

For the record, this error isnt un-google-able, first link when you google the line is a post here at: http://www.gamedev.net/community/forums/topic.asp?topic_id=561460

This topic is closed to new replies.

Advertisement