프로그램 작성시 간혹 실수하는 부분인데  이미지 파일의 오류가 나서 scale이 없는 경우가 발생합니다. 이때 sprite 클래스나 다른 scale 값이 잘못 들어가나 라고 판단 할수 있습니다. 

다시한번 이미지 파일이나 이미지 파일 경로가 잘못되어 있는지 확인하는것이 중요합니다. 

//최초 SRV 생성
	HRESULT hr;
	ID3D11ShaderResourceView* srv;
	hr = D3DX11CreateShaderResourceViewFromFile(Device, file.c_str(), NULL, NULL, &srv, NULL);
	assert(SUCCEEDED(hr));

이름값형식

error-> 

scale 식별자 "scale"이(가) 정의되어 있지 않습니다.

 


D_SCL-SECURE_NO_WARNING ERROR 해결법

처음 격어보게 되어 남기게 되었습니다.

코드를 다른 컴퓨터에서 작업할시에   
심각도 코드 설명 프로젝트 파일 줄 비표시 오류(Suppression) 상태
오류


C4996'std::copy::_Unchecked_iterators::_Deprecate': Call to 'std::copy' with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators' test c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.14.26428\include\xutility 2483



발생하는 에러가 발생하였을때 해결법 

보통 일반적인 전역 헤더파일이 존재할것이다.


예제) 전역헤더

    #pragma once
    #include
    #include
    #include
    #include
    #include
    using namespace std;




처음 격어본 에러로써 해결방법으론 


  

   #define  _SCL_SECURE_NO_WARNINGS




전역 헤더에서 가장위에 선언을 해주는것이다.


예제) 전역헤더 (추가  #define  _SCL_SECURE_NO_WARNINGS)


    #pragma once
    #define  _SCL_SECURE_NO_WARNINGS
    #include
    #include
    #include
    #include
    #include
    using namespace std;


    
    
    이렇게 하면 기존의 소스 코드를 전혀 변경하지 않고 컴파일할 수 있습니다. 단지, 보안 취약점은 여전히 안고 간다는 문제가 있다고 합니다.
    
    
    참조 사이트 입니다: https://stackoverflow.com/questions/25046829/what-does-use-d-scl-secure-no-warnings-mean
                       https://www.sysnet.pe.kr/2/0/11317 

+ Recent posts