Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need to include strsafe.h after tchar.h Error

I'm trying to build application using Visual studio 2012 I'm getting following error while compiling

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

i included tchar.h after strsafe.h in stdafx.h file. still i'm getting same error . how to troubleshoot this problem

like image 660
Raveendra M Pai Avatar asked May 31 '13 08:05

Raveendra M Pai


1 Answers

Reverse the order of inclusion? The error states that you should(*) include strsafe.h after tchar.h. – Joachim Pileborg May 31 '13 at 8:25

(*) == must

Move the #include for tchar.h up in the list of includes. And do consider not including it at all, these tchar practices date from the previous century. There is no version of Windows left that still needs it. The floppy disk drive on the last machine that still boots a non-Unicode version of Windows died last week, problem solved. – Hans Passant May 31 '13 at 12:50

like image 195
Martin Ba Avatar answered Oct 18 '22 10:10

Martin Ba