Need help with an error message virtual studio is giving me.

Started by
20 comments, last by Enerjak 8 years, 3 months ago

I'm not sure if this is the right board to post this in but here goes. I recently got this book from my library: http://www.amazon.com/Real-Time-Rendering-DirectX-HLSL-Programming/dp/0321962729 . I downloaded the code from the companion website, tried to run the demos and got this:

7e947aba00.png

I attempted to find out what's wrong by doing this:

beec1824c3.png

But when I try to compile, I get these errors right here:


2>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4460,5): error MSB3491: Could not write lines to file "Debug\HelloShadersDemo.vcxproj.FileListAbsolute.txt". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
3>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4460,5): error MSB3491: Could not write lines to file "Debug\HelloStructsDemo.vcxproj.FileListAbsolute.txt". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

I'm not sure what to do. Also, how do I turn those blue things off? those things by the const, sttd, and strs? Thanks in advance.

Advertisement

The error message is pretty explicit. Your path names are too long. Make them shorter.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

The error message is pretty explicit. Your path names are too long. Make them shorter.

Not sure how I would go about doing that as the paths seem to be okay. Not sure how to fix this.

Copy and paste the full path to the files it's complaining about.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Copy and paste the full path to the files it's complaining about.


1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4460,5): error MSB3491: Could not write lines to file "Debug\HelloShadersDemo.vcxproj.FileListAbsolute.txt". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Here is the path of the EXE.


C:\Users\admin\Downloads\pvarcholik-real-time-3d-rendering-with-directx-and-hlsl-c7688a175aac\pvarcholik-real-time-3d-rendering-with-directx-and-hlsl-c7688a175aac\Chapter4\Visual Studio\bin\HelloShaders

I'm guessing this is the problem?


HRESULT hr;
        UINT createDeviceFlags = 0;

#if defined(DEBUG) || defined(_DEBUG)  
        createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG;
#endif

        D3D_FEATURE_LEVEL featureLevels[] = {
            D3D_FEATURE_LEVEL_11_0,
            D3D_FEATURE_LEVEL_10_1,
            D3D_FEATURE_LEVEL_10_0
        };

        ID3D11Device* direct3DDevice = nullptr;
        ID3D11DeviceContext* direct3DDeviceContext = nullptr;
        if (FAILED(hr = D3D11CreateDevice(NULL, 
			D3D_DRIVER_TYPE_HARDWARE, 
			NULL, 
			createDeviceFlags, featureLevels, ARRAYSIZE(featureLevels), D3D11_SDK_VERSION, &direct3DDevice, &mFeatureLevel, &direct3DDeviceContext)))
        {
			const char* error = DXGetErrorDescriptionA(hr);
			std::string str = "";
			str += error;
			str += " D3D11CreateDevice() failed";
            throw GameException(error, hr);
        }

        if (FAILED(hr = direct3DDevice->QueryInterface(__uuidof(ID3D11Device1), reinterpret_cast<void**>(&mDirect3DDevice))))
        {
            throw GameException("ID3D11Device::QueryInterface() failed", hr);
        }

        if (FAILED(hr = direct3DDeviceContext->QueryInterface(__uuidof(ID3D11DeviceContext1), reinterpret_cast<void**>(&mDirect3DDeviceContext))))
        {
            throw GameException("ID3D11Device::QueryInterface() failed", hr);
        }
        
		ReleaseObject(direct3DDevice);
		ReleaseObject(direct3DDeviceContext);

        mDirect3DDevice->CheckMultisampleQualityLevels(DXGI_FORMAT_R8G8B8A8_UNORM, mMultiSamplingCount, &mMultiSamplingQualityLevels);
        if (mMultiSamplingQualityLevels == 0)
        {
            throw GameException("Unsupported multi-sampling quality");
        }

        DXGI_SWAP_CHAIN_DESC1 swapChainDesc;
        ZeroMemory(&swapChainDesc, sizeof(swapChainDesc));
        swapChainDesc.Width = mScreenWidth;
        swapChainDesc.Height = mScreenHeight;
        swapChainDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
        
        if (mMultiSamplingEnabled)
        {
            swapChainDesc.SampleDesc.Count = mMultiSamplingCount;
            swapChainDesc.SampleDesc.Quality = mMultiSamplingQualityLevels - 1;
        }
        else
        {
            swapChainDesc.SampleDesc.Count = 1;
            swapChainDesc.SampleDesc.Quality = 0;
        }

        swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
        swapChainDesc.BufferCount = 1;
        swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;

        IDXGIDevice* dxgiDevice = nullptr;
        if (FAILED(hr = mDirect3DDevice->QueryInterface(__uuidof(IDXGIDevice), reinterpret_cast<void**>(&dxgiDevice))))
        {
            throw GameException("ID3D11Device::QueryInterface() failed", hr);
        }

        IDXGIAdapter *dxgiAdapter = nullptr;
        if (FAILED(hr = dxgiDevice->GetParent(__uuidof(IDXGIAdapter),reinterpret_cast<void**>(&dxgiAdapter))))
        {
            ReleaseObject(dxgiDevice);
            throw GameException("IDXGIDevice::GetParent() failed retrieving adapter.", hr);
        }

        IDXGIFactory2* dxgiFactory = nullptr;		
        if (FAILED(hr = dxgiAdapter->GetParent(__uuidof(IDXGIFactory2), reinterpret_cast<void**>(&dxgiFactory))))
        {
            ReleaseObject(dxgiDevice);
            ReleaseObject(dxgiAdapter);
            throw GameException("IDXGIAdapter::GetParent() failed retrieving factory.", hr);
        }

        DXGI_SWAP_CHAIN_FULLSCREEN_DESC fullScreenDesc;
        ZeroMemory(&fullScreenDesc, sizeof(fullScreenDesc));
        fullScreenDesc.RefreshRate.Numerator = mFrameRate;
        fullScreenDesc.RefreshRate.Denominator = 1;
        fullScreenDesc.Windowed = !mIsFullScreen;

        if (FAILED(hr = dxgiFactory->CreateSwapChainForHwnd(dxgiDevice, mWindowHandle, &swapChainDesc, &fullScreenDesc, nullptr, &mSwapChain)))
        {
            ReleaseObject(dxgiDevice);
            ReleaseObject(dxgiAdapter);
            ReleaseObject(dxgiFactory);
            throw GameException("IDXGIDevice::CreateSwapChainForHwnd() failed.", hr);
        }

        ReleaseObject(dxgiDevice);
        ReleaseObject(dxgiAdapter);
        ReleaseObject(dxgiFactory);

        ID3D11Texture2D* backBuffer;
        if (FAILED(hr = mSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), reinterpret_cast<void**>(&backBuffer))))
        {
            throw GameException("IDXGISwapChain::GetBuffer() failed.", hr);
        }

        backBuffer->GetDesc(&mBackBufferDesc);
    
        if (FAILED(hr = mDirect3DDevice->CreateRenderTargetView(backBuffer, nullptr, &mRenderTargetView)))
        {
            ReleaseObject(backBuffer);
            throw GameException("IDXGIDevice::CreateRenderTargetView() failed.", hr);
        }

        ReleaseObject(backBuffer);
        
        if (mDepthStencilBufferEnabled)
        {
            D3D11_TEXTURE2D_DESC depthStencilDesc;
            ZeroMemory(&depthStencilDesc, sizeof(depthStencilDesc));
            depthStencilDesc.Width = mScreenWidth;
            depthStencilDesc.Height = mScreenHeight;
            depthStencilDesc.MipLevels = 1;
            depthStencilDesc.ArraySize = 1;
            depthStencilDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
            depthStencilDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL;
            depthStencilDesc.Usage = D3D11_USAGE_DEFAULT;            

            if (mMultiSamplingEnabled)
            {
                depthStencilDesc.SampleDesc.Count = mMultiSamplingCount;
                depthStencilDesc.SampleDesc.Quality = mMultiSamplingQualityLevels - 1;
            }
            else
            {
                depthStencilDesc.SampleDesc.Count = 1;
                depthStencilDesc.SampleDesc.Quality = 0;
            }

            if (FAILED(hr = mDirect3DDevice->CreateTexture2D(&depthStencilDesc, nullptr, &mDepthStencilBuffer)))
            {
                throw GameException("IDXGIDevice::CreateTexture2D() failed.", hr);
            }

            if (FAILED(hr = mDirect3DDevice->CreateDepthStencilView(mDepthStencilBuffer, nullptr, &mDepthStencilView)))
            {
                throw GameException("IDXGIDevice::CreateDepthStencilView() failed.", hr);
            }
        }
		
        mViewport.TopLeftX = 0.0f;
        mViewport.TopLeftY = 0.0f;
        mViewport.Width = static_cast<float>(mScreenWidth);
        mViewport.Height = static_cast<float>(mScreenHeight);
        mViewport.MinDepth = 0.0f;
        mViewport.MaxDepth = 1.0f;

For some reason the device doesn't create. Maybe it's because my card doesn't support Direct3D11.1? That could be a reason why.

What is the error message when it fails to create a device? I.e. what does DXGetErrorDescriptionA() return when it's called in the function in which the function call fails?

Hello to all my stalkers.

What is the error message when it fails to create a device? I.e. what does DXGetErrorDescriptionA() return when it's called in the function in which the function call fails?

It says this:

2f947c39a2.png

This is annoying me if I can't figure it out.

Put a breakpoint in your code where the error message is being retrieved, and inspect the raw string in your debugger of choice. It looks like the throwing of exceptions may be complicating the retrieval of the error string.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Put a breakpoint in your code where the error message is being retrieved, and inspect the raw string in your debugger of choice. It looks like the throwing of exceptions may be complicating the retrieval of the error string.

Ah I see, I need to install windows SDK for windows 10. Silly me.

This topic is closed to new replies.

Advertisement