You must enable strsafe.h after tchar.h Error

I am trying to create an application using Visual studio 2012. I get the following error while compiling

C: \ Program Files \ Microsoft Visual Studio 11.0 \ VC \ include \ tchar.h (24): fatal error C1189: #error: you need to enable strsafe.h after tchar.h

i included tchar.h after strsafe.h in the stdafx.h file. anyway i get the same error. how to fix this problem

+6
source share
3 answers

Cancel the inclusion order? The error indicates that you should (*) include strsafe.h after tchar.h . - Joachim Pieleborg May 31 '13 at 8:25

(*) == should

Move #include for tchar.h up to the list of inclusions. And don't count it at all, these tchar practices date back to the previous century. There is no version of Windows that still needs this. The drive on the last machine that is still loading the non-Unicode version of Windows died last week, the problem is resolved. - Hans Passant May 31 '13 at 12:50

+3
source

Try adding #include to the beginning of all headers.

+1
source

Source: https://habr.com/ru/post/946244/


All Articles