는 여기 . 몇 가지 다른 버전이 있지만 이것은 내가 찾은 것 중 가장 작은 버전입니다.Visual Studio에서 오류를 '네임 스페이스/클래스를 찾을 수 없습니다'나는 다이렉트 X 11 튜토리얼을 따라하려고 2015
C2653 'Platform': is not a class or namespace name
C3861 'CreateException': identifier not found
C2039 'Storage': is not a member of 'Windows'
C2871 'Storage': a namespace with this name does not exist
C3083 'ApplicationModel': the symbol to the left of a '::' must be a type
C3083 'Package': the symbol to the left of a '::' must be a type
C2039 'Current': is not a member of 'Windows'
C2065 'Current': undeclared identifier
내가 무엇을 제출해야 할 지 모르겠습니다 또는 내가 무엇을 포함해야합니다 : 나는 그것을 포함하여 컴파일 할 때
문제는, 내가 같은 오류를 얻을. 나는에 대한 검색을 수행 할 때
플랫폼 :: 예외 :: CreateException (시간) 내가 C에서 fidnit : \ PROGRAM FILES (86) MICROSOFT VISUAL STUDIO \ 14.0 \ VC \ LIB \ 스토어 \
나는 이것을 어떻게 참조해야하는지 잘 모르겠다.
//DirectXHelper.h
#pragma once
#include <ppltasks.h> // For create_task
namespace DX
{
inline void ThrowIfFailed(HRESULT hr)
{
if (FAILED(hr))
{
// Set a breakpoint on this line to catch Win32 API errors.
throw Platform::Exception::CreateException(hr);
}
}
// Function that reads from a binary file asynchronously.
inline Concurrency::task<std::vector<byte>> ReadDataAsync(const std::wstring& filename)
{
using namespace Windows::Storage;
using namespace Concurrency;
auto folder = Windows::ApplicationModel::Package::Current->InstalledLocation;
return create_task(folder->GetFileAsync(Platform::StringReference(filename.c_str()))).then([](StorageFile^ file)
{
return FileIO::ReadBufferAsync(file);
}).then([](Streams::IBuffer^ fileBuffer) -> std::vector<byte>
{
std::vector<byte> returnBuffer;
returnBuffer.resize(fileBuffer->Length);
Streams::DataReader::FromBuffer(fileBuffer)->ReadBytes(Platform::ArrayReference<byte>(returnBuffer.data(), fileBuffer->Length));
return returnBuffer;
});
}
// Converts a length in device-independent pixels (DIPs) to a length in physical pixels.
inline float ConvertDipsToPixels(float dips, float dpi)
{
static const float dipsPerInch = 96.0f;
return floorf(dips * dpi/dipsPerInch + 0.5f); // Round to nearest integer.
}
}
참고 : 나는 Win32 콘솔 응용 프로그램 및 Win32 응용 프로그램으로 이것을 구축을 시도 같은 오류가 ThrowIfFailed
의 버전이 C++/CX (일명 /ZW
를 사용하여 UWP 응용 프로그램을 구축하는 가정 것을
튜토리얼 어떻게 프로젝트가 정확한 프로젝트 템플릿에서 시작하는 방법을 알려하지 않았다. 파일> 새로 만들기> 프로젝트> Visual C++> Windows> 유니버설> DirectX 11 App. 이러한 컴파일 오류를 피하는 많은 것들을 설정합니다. 그리고 Common 폴더 안에 DirectXHelper.h를 제공합니다. –