You are not linking against the D3D library ( D3D10. Lib ).
Up vote 1 down vote favorite share g+ share fb share tw.
Having trouble creating my swap chain. I receive the following error. DX3dApp.
Obj : error LNK2019: unresolved external symbol _D3D10CreateDeviceAndSwapChain@32 referenced in function "public: bool __thiscall DX3dApp::InitDirect3D(void)" (?InitDirect3D@DX3dApp@@QAE_NXZ) Below is the code ive done so far. #include "DX3dApp. H" bool DX3dApp::Init(HINSTANCE hInstance, int width, int height) { mhInst = hInstance; mWidth = width; mHeight = height; if(!WindowsInit()) { return false; } if(!InitDirect3D()) { return false; } } int DX3dApp::Run() { MSG msg = {0}; while (WM_QUIT!
= msg. Message) { while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) == TRUE) { TranslateMessage(&msg); DispatchMessage(&msg); } Render(); } return (int) msg. WParam; } bool DX3dApp::WindowsInit() { WNDCLASSEX wcex; wcex.
CbSize = sizeof(WNDCLASSEX); wcex. Style = CS_HREDRAW | CS_VREDRAW; wcex. LpfnWndProc = (WNDPROC)WndProc; wcex.
CbClsExtra = 0; wcex. CbWndExtra = 0; wcex. HInstance = mhInst; wcex.
HIcon = 0; wcex. HCursor = LoadCursor(NULL, IDC_ARROW); wcex. HbrBackground = (HBRUSH)(COLOR_WINDOW+1); wcex.
LpszMenuName = NULL; wcex. LpszClassName = TEXT("DirectXExample"); wcex. HIconSm = 0; RegisterClassEx(&wcex); // Resize the window RECT rect = { 0, 0, mWidth, mHeight }; AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE); // create the window from the class above mMainhWnd = CreateWindow(TEXT("DirectXExample"), TEXT("DirectXExample"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, rect.
Right - rect. Left, rect. Bottom - rect.
Top, NULL, NULL, mhInst, NULL); if (!mMainhWnd) { return false; } ShowWindow(mMainhWnd, SW_SHOW); UpdateWindow(mMainhWnd); return true; } bool DX3dApp::InitDirect3D() { DXGI_SWAP_CHAIN_DESC scd; ZeroMemory(&scd, sizeof(scd)); scd. BufferCount = 1; scd.BufferDesc. Width = mWidth; scd.BufferDesc.
Height = mHeight; scd.BufferDesc. Format = DXGI_FORMAT_B8G8R8A8_UNORM; scd.BufferDesc.RefreshRate. Numerator = 60; scd.BufferDesc.RefreshRate.
Denominator = 1; scd. BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; scd. OutputWindow = mMainhWnd; scd.SampleDesc.
Count = 1; scd.SampleDesc. Quality = 0; scd. Windowed = TRUE; HRESULT hr = D3D10CreateDeviceAndSwapChain(NULL,D3D10_DRIVER_TYPE_REFERENCE, NULL, 0, D3D10_SDK_VERSION, &scd, &mpSwapChain, &mpD3DDevice); if(!hr!
= S_OK) { return FALSE; } ID3D10Texture2D *pBackBuffer; return TRUE; } void DX3dApp::Render() { } LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { // Allow the user to press the escape key to end the application case WM_KEYDOWN: switch(wParam) { // Check if the user hit the escape key case VK_ESCAPE: PostQuitMessage(0); break; } break; // The user hit the close button, close the application case WM_DESTROY: PostQuitMessage(0); break; } return DefWindowProc(hWnd, message, wParam, lParam); } c++ c visual-c++ game-development directx link|improve this question edited Apr 27 '10 at 2:10James McNellis120k12299474 asked Apr 27 '10 at 2:04numerical252,06812262 63% accept rate.
You are not linking against the D3D library (D3D10. Lib). Add that library to your linker options (Project properties -> Linker -> Input -> Additional Dependencies).
You will need to make sure the library location is in the "Additional Library Directories" path as well.
Ahhh, thanks alot – numerical25 Apr 27 '10 at 2:08.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.