Compiling differences in Visual C++ and *nix environments - c++

Is there a difference between compiling projects in *nix environments and MS Visual C++?
For example, there is a "stdafx.h" file in Visual C++.
The reason I'm asking is that I submitted a piece of code which compiled in g++, to refactormycode.com. Then after it got a refactoring, it seemed to include a "stdafx.h", so I figured I'll download Visual C++ 2008 Express but I can't seem to get it to build.
What I'm doing is creating a new project > Create a Win32 Console Application, and replacing the auto-generated .cpp with the refactored code. Am I doing something wrong here?
This is the compiler errors I'm getting:
------ Build started: Project: bfs, Configuration: Debug Win32 ------
Compiling...
bfs.cpp
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(3) : error C2871: 'std' : a namespace with this name does not exist
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(8) : error C2143: syntax error : missing ';' before '<'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(8) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(8) : error C2238: unexpected token(s) preceding ';'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(25) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(25) : error C2143: syntax error : missing ';' before '&'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(26) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(28) : warning C4183: 'getEdges': missing return type; assumed to be a member function returning 'int'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(32) : error C2059: syntax error : '<'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(32) : error C2238: unexpected token(s) preceding ';'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(12) : error C2758: 'Vertex::Edges' : must be initialized in constructor base/member initializer list
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(25) : see declaration of 'Vertex::Edges'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(22) : error C2065: 'm_edges' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(22) : error C2228: left of '.push_back' must have class/struct/union
type is ''unknown-type''
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(27) : error C2065: 'm_edges' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(38) : error C2143: syntax error : missing ';' before '<'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(38) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(38) : error C2039: 'iterator' : is not a member of '`global namespace''
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(38) : error C2238: unexpected token(s) preceding ';'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(41) : error C2059: syntax error : '<'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(41) : error C2238: unexpected token(s) preceding ';'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(83) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(83) : error C2143: syntax error : missing ';' before '&'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(84) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(86) : warning C4183: 'getVertices': missing return type; assumed to be a member function returning 'int'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(89) : error C2146: syntax error : missing ';' before identifier 'm_vertices'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(89) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(89) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(43) : error C2758: 'Graph::Vertices' : must be initialized in constructor base/member initializer list
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(83) : see declaration of 'Graph::Vertices'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(55) : error C2065: 'm_vertices' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(55) : error C2228: left of '.insert' must have class/struct/union
type is ''unknown-type''
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(61) : error C2065: 'VertexIterator' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(61) : error C2146: syntax error : missing ';' before identifier 'iter'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(61) : error C2065: 'iter' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(62) : error C2065: 'iter' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(62) : error C2065: 'm_vertices' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(62) : error C2228: left of '.begin' must have class/struct/union
type is ''unknown-type''
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(62) : error C2065: 'iter' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(62) : error C2065: 'm_vertices' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(62) : error C2228: left of '.end' must have class/struct/union
type is ''unknown-type''
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(62) : error C2065: 'iter' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(64) : error C2065: 'iter' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(64) : error C2227: left of '->getId' must point to class/struct/union/generic type
type is ''unknown-type''
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(65) : error C2065: 'iter' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(78) : error C2065: 'VertexIterator' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(78) : error C2146: syntax error : missing ';' before identifier 'iter'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(78) : error C2065: 'iter' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(79) : error C2065: 'iter' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(79) : error C2065: 'm_vertices' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(79) : error C2228: left of '.begin' must have class/struct/union
type is ''unknown-type''
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(79) : error C2065: 'iter' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(79) : error C2065: 'm_vertices' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(79) : error C2228: left of '.end' must have class/struct/union
type is ''unknown-type''
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(79) : error C2065: 'iter' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(80) : error C2065: 'iter' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(80) : error C2541: 'delete' : cannot delete objects that are not pointers
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(85) : error C2065: 'm_vertices' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(119) : error C2143: syntax error : missing ';' before '<'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(119) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(119) : error C2238: unexpected token(s) preceding ';'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(106) : error C2065: 'UINT_MAX' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(138) : error C2065: 'queue' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(138) : error C2059: syntax error : 'const'
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(140) : error C2065: 'Attributes' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(142) : error C2065: 'q' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(142) : error C2228: left of '.push' must have class/struct/union
type is ''unknown-type''
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(143) : error C2065: 'q' : undeclared identifier
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(143) : error C2228: left of '.empty' must have class/struct/union
type is ''unknown-type''
c:\users\admin\documents\visual studio 2008\projects\alg\bfs\bfs\bfs.cpp(143) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Build log was saved at "file://c:\Users\Admin\Documents\Visual Studio 2008\Projects\alg\bfs\bfs\Debug\BuildLog.htm"
bfs - 66 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Add the below headers in the refactored code,
#include <iostream>
#include <limits>
#include <map>
#include <list>
#include <queue>

The Visual C++ compiler treats include directives for precompiled headers in a special way, and often they are called stdafx.h, so I'll describe that treatment and see if that's the issue.
Each file using stdafx.h as the precompiled header will have this line at the top.
#include "stdafx.h"
Normally, this means the compiler looks for stdafx.h in the same source folder as the file that included it. However, when stdafx.h is the precompiled header, the Visual C++ compiler automatically includes the project's stdafx.h precompiled output, regardless of where the stdafx.h header or the output is. When the same project is compiled under GCC, GCC won't know where the file is if it's in another folder. You'll have to set the include path of the project appropriately so each preprocessor-related #include can find the proper file.
Normally, when an include file is located in an unknown folder specified only by a compiler [-I] directive, the include is written as:
#include <filename.h>
Unfortunately, Visual C++ doesn't let you use this notation for the precompiled header, and you have to rely on GCC following the include paths even for files specified with "" (double quotes). This behavior may or may not be in the C++ standard, but the one thing you'll want to make sure of is you don't have any extra/unintended stdafx.h files in the source tree, or you may run into even more unexpected compiled-code differences between VC++ and GCC.

The refactored code is missing certain includes. More than likely they are included in the precompiled header, stdafx.h, which usually isn't a good idea. Add the following includes to the bfs.cpp file, in between the "stdafx.h" include and the "using" declaration:
#include "stdafx.h"
#include <set>
#include <list>
#include <map>
#include <queue>
#include <iostream>
using namespace std;
Compiling...
bfs - 0 error(s), 0 warning(s)

Perhaps try:
#include <stdafx.h> // note angle brackets
This is different from the page you linked, which looks for stdafx.h in the current directory.
Or have you tried replacing that with the #includes in the original file?

For creating a new project , I recommend this :
New Project-> Empty Project
Then,
Project->Add New Item...-> C++ File (.cpp)
It's different from Win32 Console Application.

Related

ATL complains about not including Windows after VS2012 -> VS2017

I'm currently update our projects from VS2012 to VS2017. This has led one project to crash and moan in compilation about ATL.
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(450): error C2143: syntax error: missing ')' before '__stdcall'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(450): error C2143: syntax error: missing ';' before '__stdcall'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(450): error C2059: syntax error: '__stdcall'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(450): error C2059: syntax error: ')'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(451): error C2065: 'PFNMOVEFILETRANSACTED': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(451): error C2146: syntax error: missing ';' before identifier 'pfMoveFileTransacted'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(451): error C2065: 'pfMoveFileTransacted': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(451): error C2146: syntax error: missing ';' before identifier 'GetProcAddress'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(453): error C2065: 'pfMoveFileTransacted': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(455): error C2065: 'pfMoveFileTransacted': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(571): error C2143: syntax error: missing ')' before '__stdcall'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(571): error C2143: syntax error: missing ';' before '__stdcall'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(571): error C2059: syntax error: '__stdcall'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(571): error C2059: syntax error: ')'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(572): error C2065: 'PFNFINDFIRSTFILETRANSACTED': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(572): error C2146: syntax error: missing ';' before identifier 'pfFindFirstFileTransacted'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(572): error C2065: 'pfFindFirstFileTransacted': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(572): error C2146: syntax error: missing ';' before identifier 'GetProcAddress'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(574): error C2065: 'pfFindFirstFileTransacted': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(576): error C2065: 'pfFindFirstFileTransacted': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(576): error C2065: 'FindExInfoStandard': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(576): error C2065: 'FindExSearchNameMatch': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atlcom.h(175): error C2065: 'COINIT_MULTITHREADED': undeclared identifier
1>Done building project "MyProj.vcxproj" -- FAILED.
With error lines such as "undeclared identifier" refers to headers in the windows.h library.
When I include I include through a StdAfx.h which has;
#include <atlbase.h>
#include <atlcom.h>
Regardless where I put Windows.h, the error occurs. I find it likely that it is generated by _WIN32_WINNTstuff but all of that "should" work. Is it deprecated? I don't know... Anyone have any ideas?
In my case there were multiple project including each others stdafx.h headers. This caused the macros to fail/corrupt. Sorting that out and using correct values of WINVER and _WIN32_WINNT fixed it all.
Aside from Alexander's answer make sure that you do NOT define the following:
#define NOTEXTMETRIC

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

I'm trying to add an external library to a Source mod, and I'm having some trouble

I'm trying to add this Serial Communications library to the Source SDK code to try to integrate my own serial input into Steam games. I've got the example projects on the Serial library I downloaded working fine. I added the Serial project to the Source solution and gave the "Server (HL2)" project a dependency to it (I'm using Visual Studio 2013 Express). I then went to my .cpp file under the Server (HL2) project and simply added
#include "Serial.h"
#define STRICT
#include <tchar.h>
#include <stdio.h>
#include <string.h>
which are the headers defined in the example project that was working for me, and got a lot of errors when I went to compile. The errors are all along the lines of:
\serial.h(190): error C2065: 'CE_RXOVER' : undeclared identifier
\serial.h(191): error C2065: 'CE_RXPARITY' : undeclared identifier
\serial.h(193): error C2065: 'CE_TXFULL' : undeclared identifier
\serial.h(215): error C2061: syntax error : identifier 'LPCTSTR'
\serial.h(220): error C2146: syntax error : missing ';' before identifier 'Open'
\serial.h(220): error C2433: 'CSerial::LONG' : 'virtual' not permitted on data declarations
\serial.h(220): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\serial.h(220): error C2061: syntax error : identifier 'LPCTSTR'
\serial.h(220): warning C4183: 'Open': missing return type; assumed to be a member function returning 'int'
\serial.h(223): error C2146: syntax error : missing ';' before identifier 'Close'
\serial.h(223): error C2433: 'CSerial::LONG' : 'virtual' not permitted on data declarations
\serial.h(223): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\serial.h(223): warning C4183: 'Close': missing return type; assumed to be a member function returning 'int'
\serial.h(241): error C2146: syntax error : missing ';' before identifier 'Setup'
\serial.h(241): error C2433: 'CSerial::LONG' : 'virtual' not permitted on data declarations
\serial.h(241): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\serial.h(244): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\serial.h(244): warning C4183: 'Setup': missing return type; assumed to be a member function returning 'int'
\serial.h(250): error C2146: syntax error : missing ';' before identifier 'SetEventChar'
\serial.h(250): error C2433: 'CSerial::LONG' : 'virtual' not permitted on data declarations
They repeat and then...
\serial.h(361): error C2061: syntax error : identifier 'LPOVERLAPPED'
\serial.h(329): error C2065: 'm_lLastError' : undeclared identifier
\serial.h(345): error C2065: 'DCBlength' : undeclared identifier
\serial.h(345): error C2065: 'DCB' : undeclared identifier
\serial.h(345): error C2070: 'unknown-type': illegal sizeof operand
There's also a whole lot more "undeclared identifiers" where that came from. I feel like there's a very obvious solution somewhere, either the way I have the solution set up or the linker or something. But it finds the file, it's just not interpreting it correctly it seems. When I take out
#include "Serial.h"
It compiles fine, so it has something to do with the way I'm adding that new header file. Any help would be much appreciated.

Visual Studio include files calling error - C++

I'm building one sample from CEGUI, the SDK seems to be fine setle and the futher errors regarding the CEGUI on the log seems to come because of the errors with the includes from MVS. I can't affirm this since I'm not a C++ expert yet...I'm more experienced with Java..
Anyway, I saw a lot of posts talking about those compile errors, even since 2005, but some of them are just threw away, descontinued or the others that has an answer I couldn't fully understand (I supose until now they dont fit on my case...).
I can list here some posts I tryed to find an answer:
http://www.ogre3d.org/forums/viewtopic.php?p=205194
error C2039: 'find' : is not a member of 'std'
error C2039: 'memchr' : is not a member of '`global namespace''
Syntax Errors in standard Microsoft files "iosfwd" & "atlconv.h" while compiling a VS2008 soln?
I don't really get whats going wrong on my programm, so I'm seeking for help here cos I've been stuck here for 2 days reading things and trying to solve my own, I don't know what else to do to go futher. Could someone try to explain me what might be wrong with the compilation?
1>------ Build started: Project: Almost giving up, Configuration: Debug Win32 ------
1> main.cpp
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(517): error C2039: 'memcmp' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(517): error C3861: 'memcmp': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(523): error C2039: 'strlen' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(523): error C3861: 'strlen': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(546): error C2039: 'memchr' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(546): error C3861: 'memchr': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(559): error C2039: 'memset' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd(559): error C3861: 'memset': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2651): error C2039: 'memset' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2651): error C3861: 'memset': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2656): error C2039: 'memset' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2656): error C3861: 'memset': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2661): error C2039: 'memset' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2661): error C3861: 'memset': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2685): error C2039: 'memset' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2685): error C3861: 'memset': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2692): error C2039: 'memset' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2692): error C3861: 'memset': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2699): error C2039: 'memset' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2699): error C3861: 'memset': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2964): error C2039: 'memcmp' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2964): error C3861: 'memcmp': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2970): error C2039: 'memcmp' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2970): error C3861: 'memcmp': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2976): error C2039: 'memcmp' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(2976): error C3861: 'memcmp': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3125): error C2039: 'memcmp' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3125): error C3861: 'memcmp': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3193): error C2039: 'memchr' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3193): error C3861: 'memchr': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3200): error C2039: 'memchr' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3200): error C3861: 'memchr': identifier not found
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3208): error C2039: 'memchr' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(3208): error C3861: 'memchr': identifier not found
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(44): error C2146: syntax error : missing ';' before identifier 'utf8'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(44): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(46): error C2146: syntax error : missing ';' before identifier 'utf32'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(46): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(51): error C2146: syntax error : missing ';' before identifier 'encoded_char'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(51): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(51): error C2378: 'CEGUI::utf8' : redefinition; symbol cannot be overloaded with a typedef
1> c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(44) : see declaration of 'CEGUI::utf8'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(64): error C2504: 'AllocatedObject' : base class undefined
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(64): error C2143: syntax error : missing ',' before '<'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(70): error C2146: syntax error : missing ';' before identifier 'value_type'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(70): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(87): error C2143: syntax error : missing ';' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(87): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(471): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(471): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(503): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(503): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(503): error C2535: 'CEGUI::String::String(const int)' : member function already defined or declared
1> c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(471) : see declaration of 'CEGUI::String::String'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(862): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(862): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(897): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(897): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(935): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(935): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(936): error C2535: 'int CEGUI::String::compare(CEGUI::String::size_type,CEGUI::String::size_type,const int) const' : member function already defined or declared
1> c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(897) : see declaration of 'CEGUI::String::compare'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1082): error C2143: syntax error : missing ';' before '['
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1082): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1083): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1162): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1162): error C2143: syntax error : missing ';' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1163): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1165): warning C4183: 'data': missing return type; assumed to be a member function returning 'int'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1207): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1207): error C2061: syntax error : identifier 'utf8'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1381): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1381): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1381): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1404): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1404): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1404): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1430): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1430): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1430): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1431): error C2535: 'CEGUI::String &CEGUI::String::assign(const int)' : member function already defined or declared
1> c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1404) : see declaration of 'CEGUI::String::assign'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1454): error C2535: 'CEGUI::String &CEGUI::String::operator =(const int)' : member function already defined or declared
1> c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1381) : see declaration of 'CEGUI::String::operator ='
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1728): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1728): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1728): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1751): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1751): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1751): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1778): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1778): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1778): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1779): error C2535: 'CEGUI::String &CEGUI::String::append(const int)' : member function already defined or declared
1> c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1751) : see declaration of 'CEGUI::String::append'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1807): error C2535: 'CEGUI::String &CEGUI::String::operator +=(const int)' : member function already defined or declared
1> c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(1728) : see declaration of 'CEGUI::String::operator +='
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2115): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2115): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2145): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2145): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2146): error C2535: 'CEGUI::String &CEGUI::String::insert(CEGUI::String::size_type,const int)' : member function already defined or declared
1> c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2115) : see declaration of 'CEGUI::String::insert'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2747): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2747): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2779): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2779): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2812): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2812): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2813): error C2535: 'CEGUI::String &CEGUI::String::replace(CEGUI::String::size_type,CEGUI::String::size_type,const int)' : member function already defined or declared
1> c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2747) : see declaration of 'CEGUI::String::replace'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2867): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2867): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2868): error C2535: 'CEGUI::String &CEGUI::String::replace(CEGUI::String::iterator,CEGUI::String::iterator,const int)' : member function already defined or declared
1> c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(2779) : see declaration of 'CEGUI::String::replace'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3388): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3388): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3388): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3415): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3415): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3415): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3445): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3445): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3445): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3446): error C2535: 'CEGUI::String::size_type CEGUI::String::find(const int) const' : member function already defined or declared
1> c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3388) : see declaration of 'CEGUI::String::find'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3496): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3496): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3496): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3497): error C2535: 'CEGUI::String::size_type CEGUI::String::rfind(const int) const' : member function already defined or declared
1> c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3415) : see declaration of 'CEGUI::String::rfind'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3820): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3820): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3820): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3847): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3847): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3847): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3877): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3877): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3877): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3878): error C2535: 'CEGUI::String::size_type CEGUI::String::find_first_of(const int) const' : member function already defined or declared
1> c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3820) : see declaration of 'CEGUI::String::find_first_of'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3925): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3925): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3925): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3926): error C2535: 'CEGUI::String::size_type CEGUI::String::find_first_not_of(const int) const' : member function already defined or declared
1> c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(3847) : see declaration of 'CEGUI::String::find_first_not_of'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(4302): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(4302): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(4302): error C2143: syntax error : missing ',' before '*'
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(4329): error C2327: 'CEGUI::String::utf8' : is not a type name, static, or enumerator
1>c:\program files (x86)\cegui\cegui-0.8.2\cegui\include\cegui\string.h(4329): fatal error C1003: error count exceeds 100; stopping compilation
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skippe
d ==========
Code:
#include <RendererModules\Ogre\Renderer.h>
int main(){
// Bootstrap CEGUI::System with an OgreRenderer object that uses the
// default Ogre rendering window as the default output surface, an Ogre based
// ResourceProvider, and an Ogre based ImageCodec.
CEGUI::OgreRenderer& myRenderer =
CEGUI::OgreRenderer::bootstrapSystem();
}
The code comes from http://www.cegui.org.uk/docs/current/rendering_tutorial.html ; Even that doesnt say anything about include xutility or iosfwd I already tryed to do but the error is the same, I also tryed to open the files from VS but since I'm not an expert I couldnt fully understand to check for any errors, which I can't believe thats wrong since its a default file..
I know this is an old post but I figured I would answer it.
If you include cegui-0.8.7\cegui\include\CEGUI in your MSVC include directories then it will suck up the String.h file in there and then will use THAT definition EVERYWHERE. Thus you start seeing things like xutility and iosfwd show up in the tainting.
Instead you must include ...\cegui-0.8.7\cegui\include so that it is scoped with CEGUI and does not confuse your entire build system.
Hope this helps someone!

Build Error in the "refclock.h" header file, a part of Windows platform SDK

I am building a VC++ solution & using Win& SDK & Win8 SDK (including these paths in LIB & INCLUDE settings of VS2008).
But I am getting the following build error in refclock.h header file.
I don't understand how can we get the error in a standard MSFT header file. Can anyone kindly help me in getting this fixed?
c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(80) : error C2061: syntax error : identifier 'CAMSchedule'
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(139) : error C2143: syntax error : missing ';' before '*'
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(139) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(139) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(139) : warning C4183: 'GetSchedule': missing return type; assumed to be a member function returning 'int'
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(178) : error C2143: syntax error : missing ';' before '*'
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(178) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(178) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(139) : error C2065: 'm_pSchedule' : undeclared identifier
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(166) : error C2065: 'm_pSchedule' : undeclared identifier
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(166) : error C2227: left of '->GetEvent' must point to class/struct/union/generic type
It's caused by an error in the refclock.h header and the order your include directories are specified in Visual Studio.
You need to have the BaseClasses directory (Samples/Multimedia/DirectShow) before the SDK include directory, since they both have a schedule.h file and refclock.h uses <> not "" for the include.