Tesseract 3.05 Build errors in Visual Studio 2017 - c++

I used the solution provided here in order to make Tesseract 3.05 work on my windows10 x64 project, visual studio 2017.
I got these errors when building it:
11>c:\users\mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unichar.h(164): error C3646: 'UTF32ToUTF8': unknown override specifier
11>c:\users\mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unichar.h(164): error C2059: syntax error: 'const'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unichar.h(164): error C2238: unexpected token(s) preceding ';'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\genericvector.h(376): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\params.h(205): warning C4800: 'BOOL8': forcing value to bool 'true' or 'false' (performance warning)
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(241): error C3646: 'CleanupString': unknown override specifier
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(241): error C2059: syntax error: 'const'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(241): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(244): error C3646: 'CleanupString': unknown override specifier
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(244): error C2059: syntax error: 'const'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(244): error C2238: unexpected token(s) preceding ';'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(265): error C2065: 'string': undeclared identifier
11>c:\users\mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(265): error C2146: syntax error: missing ';' before identifier 'cleaned'
11>c:\users\ mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(265): error C2065: 'cleaned': undeclared identifier
11>c:\users\mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(265): error C3861: 'CleanupString': identifier not found
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\unicharset.h(266): error C2065: 'cleaned': undeclared identifier
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(181): error C3646: 'VersionString': unknown override specifier
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(181): error C2059: syntax error: '('
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(181): error C2238: unexpected token(s) preceding ';'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(183): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(183): error C2143: syntax error: missing ',' before '&'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(134): error C2664: 'void tesseract::TessdataManager::SetVersionString(const int)': cannot convert argument 1 from 'const char [13]' to 'const int'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(134): note: There is no context in which this conversion is possible
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(138): error C2664: 'void tesseract::TessdataManager::SetVersionString(const int)': cannot convert argument 1 from 'const char [13]' to 'const int'
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\ccutil\tessdatamanager.h(138): note: There is no context in which this conversion is possible
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\dict\dict.h(55): warning C4566: character represented by universal-character-name '\u2606' cannot be represented in the current code page (1252)
11>c:\users\jihed mestiri\documents\vs2015_tesseract-master\vs2015_tesseract-master\tesseract_3.05\api\tesseractmain.cpp(34): fatal error C1083: Cannot open include file: 'simddetect.h': No such file or directory
11>Done building project "tesseract.vcxproj" -- FAILED.
========== Build: 9 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
How to resolve them?

Since the time of the linked answer, project structure was changed. It's updated to Tesseract 3.05 and clear Git submodule links to the proper Leptonica and tesseract_3.05 sources added.
It looks like you've downloaded master sources for both of them. At the moment VS2015_Tesseract is not compatible with it.
Proper dependency links are: leptonica # e98a794 and tesseract_3.05 # 7fe95f0. Download it and try to rebuild the solution.

After adding in C/C++ -> Additional Include libraries:
C:\Users\Jihed Mestiri\Documents\VS2015_Tesseract-master\liblept
C:\Documents\VS2015_Tesseract-master\leptonica\src
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\wordrec
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\opencl
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\viewer
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\textord
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\neural_networks\runtime
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\dict
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\cutil
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\cube
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\classify
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\ccstruct
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\ccutil
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\ccmain
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\api
C:\Users\Documents\VS2015_Tesseract-master\tesseract_3.05\vs2010\port
as well as the directory that contains .lib files in Linker -> General -> Additional Library directories and included in Linker -> Input -> Additional dependencies these .lib files of Tesseract and Leptonica:
libtesseract.lib
giflib.lib
libjpeg.lib
liblept.lib
libpng.l‌​ib
libtiff.lib
li‌​bwe‌​bp.lib
openjpeg.lib
‌​zlib.lib
Compilation errors of my test program changed to:
1>------ Build started: Project: RedEyeRemover, Configuration: Debug x64 ------
1>LINK : fatal error LNK1104: cannot open file 'libpng.l‌​ib'
1>Done building project "RedEyeRemover.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Whereas the directory that contains libpng.lib file is included in Linker->General.
The parameters are taken from tesseract/tesseract.vcxproj that I build from VS2015_Tesseract
What can be the reason behind that error? and is there a way to verify that tesseract.vcxproj is working correctly at its own? because I get errors when I compile it too on Visual Studio 2017 (using v140 = VS 2015 version for build) on x64 target.
EDIT: SOLUTION: I discovered that the problem was in Linker -> General -> Additional Library directories where I had a space in one of the parent directory of the path e.g: "xxx xxx/tesseract". => avoid using paths with space.

Related

Installing OpenCV in C++ Visual Studio: How can I fix these linker errors that occur although I followed the installation tutorial?

I have tried downloading the C++ OpenCV Library to Visual Studio 2019.
When trying to compile my code, I am getting these errors:
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(40,9): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(40,19): error C2059: syntax error: 'constant'
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(42,1): error C2143: syntax error: missing ';' before '{'
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(42,1): error C2447: '{': missing function header (old-style formal list?)
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(68,62): error C2039: 'has_parenthesis_operator': is not a member of 'cv::sfinae'
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(39): message : see declaration of 'cv::sfinae'
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(68,1): error C2065: 'has_parenthesis_operator': undeclared identifier
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(68,1): error C2977: 'std::enable_if': too many template arguments
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xtr1common(46): message : see declaration of 'std::enable_if'
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(68,117): error C2955: 'std::enable_if': use of class template requires template argument list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xtr1common(46): message : see declaration of 'std::enable_if'
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(68,131): error C2988: unrecognizable template declaration/definition
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(68,131): error C2059: syntax error: '>'
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(69,11): error C2988: unrecognizable template declaration/definition
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(69,11): error C2059: syntax error: 'public'
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(69,1): error C2143: syntax error: missing ';' before '{'
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(69,1): error C2447: '{': missing function header (old-style formal list?)
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(80,26): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(140): message : see reference to class template instantiation 'cv::Ptr<T>' being compiled
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(80,35): error C2059: syntax error: 'constant'
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(80,26): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
1>C:\opencv-4.5.4\opencv\build\include\opencv2\core\cvstd_wrapper.hpp(140,1): fatal error C1903: unable to recover from previous error(s); stopping compilation
I suspect it is a linker errors, so I went ahead and made sure I have included all the dependencies and libraries, and I have done as follows, I included the opencv libraries and the library directories and added the additional dependencies:
yet I am still getting the same errors. Does anyone know how I can get rid of them?
Thank you for your help!
Link to the images: https://imgur.com/a/M1UV7yL

Using Boost.Json lib in Visual Studio 2013

I have been trying to use new Boost.Json lib that was launched in the latest version of boost 1.75.0. For testing purposes I created an empty VS project and added one file and tried to build it. I added the directory in the project's additional include directory. This is what my source file looks like:
#include <boost\json.hpp>
void main(){
return;
}
When I compile this I get following error:
Error 8 error C1903: unable to recover from previous error(s); stopping compilation
C:\Libraries\boost_1_75_0\boost\json\detail\config.hpp 311 1 Project1
Error 5 error C2065: 'T' : undeclared identifier
C:\Libraries\boost_1_75_0\boost\json\detail\config.hpp 311 1 Project1
Error 7 error C2143: syntax error : missing ';' before
'boost::json::detail::static_const<T>::value'
C:\Libraries\boost_1_75_0\boost\json\detail\config.hpp 311 1 Project1
Error 2 error C2146: syntax error : missing ';' before identifier 'T'
C:\Libraries\boost_1_75_0\boost\json\detail\config.hpp 308 1 Project1
Error 4 error C2146: syntax error : missing ';' before identifier 'T'
C:\Libraries\boost_1_75_0\boost\json\detail\config.hpp 311 1 Project1
Error 6 error C2923: 'boost::json::detail::static_const' : 'T' is not a valid template type
argument for parameter 'T' C:\Libraries\boost_1_75_0\boost\json\detail\config.hpp 311 1 Project1
Error 1 error C3646: 'noexcept' : unknown override specifier
C:\Libraries\boost_1_75_0\boost\json\detail\config.hpp 292 1 Project1
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Libraries\boost_1_75_0\boost\json\detail\config.hpp 308 1 Project1
Just to verify if I included the boost lib right, I wrote another code
#include <boost\property_tree\json_parser.hpp>
void main(){
return;
}
and it compiled fine. The reason I want to use json lib instead of property trees is because I want to retain the data type of the json objects whereas trees parse everything in string. Any help will be really appreciated. Thank you.
Boost.JSON is not tested to compile with Visual Studio 2013. I doubt that it could ever work, as that version of the IDE and compiler does not support C++11 sufficiently for the library.

Having issues with linking to boost library (C++ in Visual Studio 2013)

I have been banging my head on this for a few days now. I tried downloading and compiling the latest boost 1.67.0, to include
#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/process.hpp>
But I got the errors seen below when trying to compile (one thing I noticed about it is that the path has slashes going the wrong way in the error log and Im not sure how to fix that?
I tried compiling with standard cmd and also Visual Studio 2013 prompt (same result).
I then tried grabbing the precompiled version from boost site
boost_1_67_0-msvc-12.0-32.exe
And am still getting the same problem. The #include text is not underlined in the editor. And I have additional include directories pointing to:
C:\VisualStudioLibraries\boost_1_67_0
and Linker Additional Library Directories to
C:\VisualStudioLibraries\boost_1_67_0\stage\lib
Does anyone know how to resolve this? If I comment out the #include lines for boost the code compiles without any issues and program runs. My code doesnt use anything from boost yet, so the only boost related stuff in there are the 3 #include lines.
Errors are:
1> MyForm.cpp
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(65): error C3646: 'noexcept' : unknown override specifier
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(72): error C2660: 'boost::process::process_error::process_error' : function does not take 2 arguments
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(77): error C2660: 'boost::process::process_error::process_error' : function does not take 2 arguments
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(82): error C2440: '' : cannot convert from 'std::error_code' to 'boost::process::process_error'
1> No constructor could take the source type, or constructor overload resolution was ambiguous
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(88): error C2440: '' : cannot convert from 'const std::error_code' to 'boost::process::process_error'
1> No constructor could take the source type, or constructor overload resolution was ambiguous
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(94): error C2660: 'boost::process::process_error::process_error' : function does not take 2 arguments
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(97): error C2146: syntax error : missing ';' before identifier 'Char'
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(97): error C2146: syntax error : missing ';' before identifier 'null_char'
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(97): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(98): error C2144: syntax error : 'char' should be preceded by ';'
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(98): error C2143: syntax error : missing ';' before '<'
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(99): error C2143: syntax error : missing ';' before '{'
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(99): error C2447: '{' : missing function header (old-style formal list?)
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(101): error C2146: syntax error : missing ';' before identifier 'Char'
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(101): error C2146: syntax error : missing ';' before identifier 'equal_sign'
1>C:\VisualStudioLibraries\boost_1_67_0\boost/process/detail/config.hpp(101): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Thank you all very much.
Well, Im sure this is not the answer most will want to hear, but after trying for over a week to get it to work the only thing that ended up working was to move on to Visual Studio 2017. Everything linked and compiled fine there. Perhaps there is an issue with my VS2013 install (but everything else works flawlessly on it).

Visual Studio Community 2015 MFC empty project doesn't compile

I just installed Visual Studio Community 2015 (version 14.0.24720.00) and tried to create an MFC dialog based project.
In the wizard I only selected "Dialog based", leaving all the other settings to default.
The project simply doesn't compile, which isn't exactly a promising starting point...
Am I overlooking something? Is the MFC template broken?
Below, the compile time errors I get (I cut away the long paths for the sake of legibility).
Thanks for your time.
program files (x86)\microsoft visual studio 14.01>------ Build started: Project: MFCApplication, Configuration: Debug Win32 ------
1> stdafx.cpp
1>c:\[...omissis...]\atlcore.h(639): error C2065: 'LOAD_LIBRARY_SEARCH_SYSTEM32': undeclared identifier
1>c:\[...omissis...]\uianimation.h(2621): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\[...omissis...]\afxanimationhelper.h(411): error C2065: 'UI_E_VALUE_NOT_SET': undeclared identifier
1>c:\[...omissis...]\afxanimationhelper.h(441): error C2065: 'UI_E_VALUE_NOT_SET': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2103): error C3646: 'm_pConfigs': unknown override specifier
1>c:\[...omissis...]\afxwin.h(2103): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\[...omissis...]\afxwin.h(2024): error C2065: 'GC_PAN_WITH_GUTTER': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2024): error C2065: 'GC_PAN_WITH_INERTIA': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2088): error C2065: 'GC_ALLGESTURES': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2030): error C2065: 'GID_ZOOM': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2030): error C2065: 'GC_ZOOM': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2036): error C2065: 'GID_ROTATE': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2036): error C2065: 'GC_ROTATE': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2042): error C2065: 'GID_TWOFINGERTAP': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2042): error C2065: 'GC_TWOFINGERTAP': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2056): error C2065: 'GID_PAN': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2056): error C2065: 'GC_PAN': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2062): error C2065: 'GID_PAN': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2062): error C2065: 'GC_PAN_WITH_SINGLE_FINGER_VERTICALLY': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2068): error C2065: 'GID_PAN': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2068): error C2065: 'GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2074): error C2065: 'GID_PAN': undeclared identifier
1>c:\[...omissis...]\afxw
in.h(2074): error C2065: 'GC_PAN_WITH_GUTTER': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2080): error C2065: 'GID_PAN': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2080): error C2065: 'GC_PAN_WITH_INERTIA': undeclared identifier
1>c:\[...omissis...]\afxwin.h(2964): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\[...omissis...]\afxwin.h(2964): error C3646: 'GetCurrentGestureInfo': unknown override specifier
1>c:\[...omissis...]\afxwin.h(2964): error C2059: syntax error: ')'
1>c:\[...omissis...]\afxwin.h(2965): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>c:\[...omissis...]\afxwin.h(3020): error C2061: syntax error: identifier 'PTOUCHINPUT'
1>c:\[...omissis...]\afxwin.h(3030): error C2061: syntax error: identifier 'PTOUCHINPUT'
1>c:\[...omissis...]\afxwin.h(3043): error C3646: 'm_pCurrentGestureInfo': unknown override specifier
1>c:\[...omissis...]\afxwin.h(3043): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\[...omissis...]\afxwin.h(4141): error C2061: syntax error: identifier 'TBPFLAG'
1>c:\[...omissis...]\afxwin.h(5447): error C2143: syntax error: missing ';' before '*'
1>c:\[...omissis...]\afxwin.h(5447): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\[...omissis...]\afxwin.h(5447): error C2238: unexpected token(s) preceding ';'
1>c:\[...omissis...]\afxglobals.h(315): error C2143: syntax error: missing ';' before '*'
1>c:\[...omissis...]\afxglobals.h(315): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\[...omissis...]\afxglobals.h(315): error C2238: unexpected token(s) preceding ';'
1>c:\[...omissis...]\afxadv.h(244): error C2143: syntax error: missing ';' before '*'
1>c:\[...omissis...]\afxadv.h(244): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\[...omissis...]\afxadv.h(245): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>c:\[...omissis...]\afxadv.h(314): error C2061: syntax error: identifier 'KNOWNDESTCATEGORY'
1>c:\[...omissis...]\afxadv.h(390): error C2065: 'ICustomDestinationList': undeclared identifier
1>c:\[...omissis...]\afxadv.h(390): error C2923: 'ATL::CComPtr': 'ICustomDestinationList' is not a valid template type argument for parameter 'T'
1>c:\[...omissis...]\afxadv.h(273): error C2039: 'AbortList': is not a member of 'ATL::_NoAddRefReleaseOnCComPtr<T>'
1>c:\[...omissis...]\afxadv.h(428): error C2065: 'IApplicationDestinations': undeclared identifier
1>c:\[...omissis...]\afxadv.h(428): error C2923: 'ATL::CComPtr': 'IApplicationDestinations' is not a valid template type argument for parameter 'T'
1>c:\[...omissis...]\afxadv.h(430): warning C4624: 'CAppDestinations': destructor was implicitly defined as deleted
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Solved.
Visual studio 2015 inherited the Visual Studio 2009 settings.
Removing the include folder
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
everything started to work normally
Had a similar problem bringing 2010 forward to 2015. Tracked the problem down to the targetver.h file. It was defining older versions of windows. Replaced all previous defines with the current default.
target.h
// delete everything here
#include <SDKDDKVer.h>
-- end of target.h
Maybe this can help you to fix your problem.
In Visual Studio 2015, C++ tooling is no longer installed by default. Instead, the C++ compiler, libraries, and project templates have been moved into an optional feature. Upon launching setup, you can choose a “Typical” or “Custom” install;
If you choose “Typical”, then you can’t use Visual Studio to develop in C++, because only managed languages and web development tools will be installed.
Setup Changes in Visual Studio 2015 Affecting C++ Developers

Include winnt.h in my project

I am doing a small personal project involving printing out info about a PE file.
I have read that most of the pe structure is already defined in winnt.h header.
Upon including the winnt.h, and compiling the project i get the following error:
#error : "No Target Architecture"
I tried putting a define x86, it might have fixed the architecture problem, but there are even more compilation problems.
For example:
1>c:\program files (x86)\windows kits\8.0\include\um\winnt.h(363): error C2146: syntax error : missing ';' before identifier 'WCHAR'
1>c:\program files (x86)\windows kits\8.0\include\um\winnt.h(363): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\um\winnt.h(367): error C2143: syntax error : missing ';' before '*'
1>c:\program files (x86)\windows kits\8.0\include\um\winnt.h(367): error C2040: 'PWSTR' : 'CONST' differs in levels of indirection from 'WCHAR *'
check Compiler->Enable Microsoft extensions in Project options or use -Ze flag if you're compiling from the command line.