errors occur when using cl cmd to generate dll file? - c++

Today, I used cl cmd which is vs 2010 attached to compile a demo to gain a dll file. I written a file, its content as follow:
CALL "D:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
cl /LD getKLineForKdb.cpp getKLineForKdb.def TDB_API_Windows_v2.lib q.lib
and saved it as comprun.bat. When I used cmd to run it, some error messages occurred:
d:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\xlocale(323) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\wingdi.h(4562) : error C2143: syntax error : missing ',' before '->'
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\wingdi.h(4563) : error C2143: syntax error : missing ',' before '->'
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\mmsystem.h(770) : error C2059: syntax error : 'constant'
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\mmsystem.h(770) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\mmsystem.h(770) : warning C4183: 'waveformat_tag': missing return type; assumed to be a member function returning 'int'.
Does anyone face this problem? Thanks.

Related

Doxygen : namespaces and CLANG

I try to document some C++ code, but the Doxygen parser is not able to understand my code because I use a special macro to define the namespaces.
For now, I bypass this detail.
So, I try to use clang, but I got tons of errors, mainly because it try to analyse the MS code. I got such kind of error messages with clang :
error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\xtr1common:212:22: error: use of undeclared identifier 'char16_t' [clang]
error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\xtr1common:218:22: error: use of undeclared identifier 'char32_t' [clang]
error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\xstddef:399:14: error: use of undeclared identifier 'char16_t' [clang]
error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\xstddef:405:14: error: use of undeclared identifier 'char32_t' [clang]
error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\xstddef:635:2: error: 'auto' return without trailing return type; deduced return types are a C++14 extension [clang]
error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\type_traits:592:45: error: '_To' does not refer to a value [clang]
error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\type_traits:592:50: error: '_From' does not refer to a value [clang]
error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\type_traits:593:2: error: expected class name [clang]
error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\type_traits:1284:32: error: unknown type name '__make_integer_seq' [clang]
error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\type_traits:1284:50: error: expected ';' after alias declaration [clang]
error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\type_traits:1290:30: error: unknown type name 'make_integer_sequence' [clang]
error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\type_traits:1290:51: error: expected ';' after alias declaration [clang]
error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\type_traits:1293:29: error: unknown type name 'make_index_sequence' [clang]
error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\type_traits:1293:48: error: expected ';' after alias declaration [clang]
error : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\include\limits:612:33: error: use of undeclared identifier 'char16_t' [clang]

using swap with template argument conflicts with std::vector include

Today I came across a really strange behavior of the msvc2013 compiler.
After nearly an hour, I found the causing bug.
Minimal example:
#include <iostream>
#include <vector>
int main(int argc, char *argv[])
{
float f1, f2;
std::swap<float>(f1, f2);
return 0;
}
When including std::vector, I get a bunch of very strange compiler errors with msvc2013! When compiling the code with mingw the code compiles fine, just as I would expect.
The errors:
main.cpp
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xlocale(341): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vector(1892): error C2825: '_Alloc': must be a class or namespace when followed by '::'
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vector(1944): note: see reference to class template instantiation 'std::_Vb_iter_base<_Alloc>' being compiled
with
[
_Alloc=float
]
main.cpp(10): note: see reference to class template instantiation 'std::_Vb_reference<float>' being compiled
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vector(1892): error C2510: '_Alloc': left of '::' must be a class/struct/union
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vector(1892): error C2146: syntax error: missing '>' before identifier 'difference_type'
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vector(1898): error C2825: '_Alloc': must be a class or namespace when followed by '::'
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vector(1898): error C2510: '_Alloc': left of '::' must be a class/struct/union
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vector(1898): error C3646: '_Sizet': unknown override specifier
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vector(1898): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vector(1906): error C2061: syntax error: identifier '_Sizet'
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vector(1913): error C2061: syntax error: identifier '_Sizet'
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vector(1920): error C2061: syntax error: identifier '_Sizet'
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vector(1937): error C3646: '_Myoff': unknown override specifier
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\vector(1937): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
And yes - i do know this is now the msvc2015 compiler! I tested this one too, and these are the error messages from this compile
Is this a weird bug in msvc or why does and can this even happen?
This is a known issue in MSVC compilers. They argue that "calling swap() with explicit template arguments is not actually permitted by the Standard".

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.

Error linking source file with static library C++

I'm trying to use the static library however when I add the reference and include directories to the project I get strange compiler errors, this including only any header file.
The static library project builds successful. I don't know where the error may be, but I suppose it may be in some file of the static library.
The static library files are the following:
header:
#ifndef UTIL_H_
#define UTIL_H_
#include <string>
#include <iostream>
#include <vector>
#include <stdlib.h>
namespace Kaczmarz {
class Util {
public:
Util();
static void split(std::vector<std::string> &tokens, const std::string &text, char sep);
static double random(int rangeMin,int rangeMax);
virtual ~Util();
};
}
#endif
cpp:
#include "Util.h"
namespace Kaczmarz {
Util::Util() {
// TODO Auto-generated constructor stub
}
void Util::split(std::vector<std::string> &tokens, const std::string &text, char sep) {
unsigned int start = 0, end = 0;
while ((end = text.find(sep, start)) != std::string::npos) {
tokens.push_back(text.substr(start, end - start));
start = end + 1;
}
tokens.push_back(text.substr(start));
}
double Util::random(int rangeMin,int rangeMax){
return (double) static_cast<double>( rand() ) * rangeMax / static_cast<double>( RAND_MAX ) + rangeMin;
}
Util::~Util() {
// TODO Auto-generated destructor stub
}
}
the file that tries to use the static library:
#include <iostream>
using namespace std;
//using namespace Kaczmarz;
int main(){
cout << "Started.." << endl;
return 0;
}
Note that I'm not calling yet any function from the library.
The errors that I got are the following:
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(21): error C2143: syntax error : missing ';' before '<'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(21): error C2433: 'basic_string' : 'inline' not permitted on data declarations
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(21): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(21): error C2988: unrecognizable template declaration/definition
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(21): error C2059: syntax error : '<'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(38): error C2143: syntax error : missing ';' before '{'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(38): error C2447: '{' : missing function header (old-style formal list?)
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(49): error C2143: syntax error : missing ';' before '<'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(49): error C2433: 'basic_string' : 'inline' not permitted on data declarations
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(49): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(49): error C2086: 'int std::basic_string' : redefinition
1> c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(21) : see declaration of 'std::basic_string'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(49): error C2988: unrecognizable template declaration/definition
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(49): error C2059: syntax error : '<'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(66): error C2143: syntax error : missing ';' before '{'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(66): error C2447: '{' : missing function header (old-style formal list?)
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(77): error C2143: syntax error : missing ';' before '<'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(77): error C2433: 'basic_string' : 'inline' not permitted on data declarations
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(77): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(77): error C2086: 'int std::basic_string' : redefinition
1> c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(21) : see declaration of 'std::basic_string'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(77): error C2988: unrecognizable template declaration/definition
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(77): error C2059: syntax error : '<'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(94): error C2143: syntax error : missing ';' before '{'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(94): error C2447: '{' : missing function header (old-style formal list?)
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(101): error C2143: syntax error : missing ';' before '<'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(101): error C2433: 'basic_string' : 'inline' not permitted on data declarations
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(101): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(101): error C2086: 'int std::basic_string' : redefinition
1> c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(21) : see declaration of 'std::basic_string'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(101): error C2988: unrecognizable template declaration/definition
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(101): error C2059: syntax error : '<'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(114): error C2143: syntax error : missing ';' before '{'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(114): error C2447: '{' : missing function header (old-style formal list?)
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(125): error C2143: syntax error : missing ';' before '<'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(125): error C2433: 'basic_string' : 'inline' not permitted on data declarations
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(125): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(125): error C2086: 'int std::basic_string' : redefinition
1> c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(21) : see declaration of 'std::basic_string'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(125): error C2988: unrecognizable template declaration/definition
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(125): error C2059: syntax error : '<'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(138): error C2143: syntax error : missing ';' before '{'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(138): error C2447: '{' : missing function header (old-style formal list?)
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(145): error C2143: syntax error : missing ';' before '<'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(145): error C2433: 'basic_string' : 'inline' not permitted on data declarations
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(145): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(145): error C2086: 'int std::basic_string' : redefinition
1> c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(21) : see declaration of 'std::basic_string'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(145): error C2988: unrecognizable template declaration/definition
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(145): error C2059: syntax error : '<'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(158): error C2143: syntax error : missing ';' before '{'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(158): error C2447: '{' : missing function header (old-style formal list?)
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(166): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(166): error C2143: syntax error : missing ',' before '<'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(170): error C2803: 'operator ==' must have at least one formal parameter of class type
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(170): error C2805: binary 'operator ==' has too few parameters
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(177): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(177): error C2143: syntax error : missing ',' before '<'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(180): error C2803: 'operator ==' must have at least one formal parameter of class type
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(186): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(186): error C2143: syntax error : missing ',' before '<'
1>c:\program files (x86)\microsoft visual studio 11.0\vc\include\string(190): fatal error C1903: unable to recover from previous error(s); stopping compilation
Note that the errors mention the std string class.
Since it's Christmas time and I see that you're using MSVS, here are steps that I did to try your library:
Step 1: I have created new solution called XmasTest with new Win32 project in it called XmasLib.
Step 2: I have added your source files in that project, just a simple example-appropriate modification. I have even let that evil using namespace std; line in the header file.
Util.h
#ifndef UTIL_H_
#define UTIL_H_
#include <string>
#include <iostream>
#include <vector>
#include <stdlib.h>
using namespace std;
namespace Kaczmarz {
class Util {
public:
Util();
static void print();
virtual ~Util();
};
} /* namespace Kaczmarz */
#endif
Util.cpp
#include "Util.h"
using namespace std;
namespace Kaczmarz {
Util::Util() {
// TODO Auto-generated constructor stub
}
void Util::print() {
cout << "Util::print() works! yay!" << endl;
}
Util::~Util() {
}
} /* namespace Kaczmarz */
Step 3: I have created new Win32 Console application called XmasLibTestApp with following code in it:
#include <iostream>
#include "../XmasLib/Util.h"
using namespace std;
using namespace Kaczmarz;
int main(){
Util u;
u.print();
return 0;
}
Step 4: Since these are 2 projects within 1 solution, I have handled the dependency in the following way:
Linker->General->Additional Library Directories: $(OutDir)
Linker->Input->Additional Dependencies: XmasLib.lib
Solution Properties->ProjectDependencies: App depends on lib
Step 5: Build Solution and run app. Output: Util::print() works! yay!
And that's it. End of the story, everything works, developer rejoices with his IDE.
Happy Xmas! :D
PS: Questions that are worth to have a look at:
Why is "using namespace std" considered bad practice?
What requires me to declare "using namespace std;"?
where to put using namespace std;
Ok found the cause of this compiling errors.
In the "additional include directories" (vs 2012) I had another .cpp/.h files which imported "Util" class.
I just removed this files from the directory and this time it compiled good without any errors. Note that this files weren't present in the project (I had excluded them), however seems that "additional include directories" linked them somehow in the project.
Thanks to all who have answered, I really appreciate it.

Release configuration build, debug doesn't

I'm developing an AutoCad plugin (MFC dll), I'm using Visual Studio 2010 and C++.
Until now I was building the project with release configuration (both 32 and 64 bits), with no problems (I've test the plugin inside AutoCad).
But now that I want to debug a function with Visual Studio 2010 just changed the configuration to Debug and the build doesn't succeeded.
The output from build process:
------ Build started: Project: SAM, Configuration: Debug x64 ------
Build started 26/01/2012 11:36:32.
InitializeBuildStatus:
Touching "x64\Debug\SAM.unsuccessfulbuild".
ClCompile:
stdafx.cpp
Note: including file: c:\vs2010_workspace\s\sam\stdafx.h
Note: including file: c:\vs2010_workspace\s\sam\targetver.h
Note: including file: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\SDKDDKVer.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxwin.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afx.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sal.h
Note: including file: c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(27): error C2448: 'message' : function-style initializer appears to be a function definition
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vadefs.h
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vadefs.h(121): error C2065: 'va_list' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vadefs.h(121): error C2059: syntax error : ','
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(486): error C2146: syntax error : missing ';' before identifier 'time_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(550): error C2061: syntax error : identifier 'uintptr_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1961): error C2146: syntax error : missing ';' before identifier 'locinfo'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1961): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1961): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1962): error C2146: syntax error : missing ';' before identifier 'mbcinfo'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1962): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1962): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1980): error C2146: syntax error : missing ';' before identifier 'lc_id'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1980): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1980): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(52): error C2143: syntax error : missing ';' before '__cdecl'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(52): error C2065: 'new_handler' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(52): error C2146: syntax error : missing ')' before identifier '_NewHandler'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(52): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(52): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(52): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(58): error C2039: 'new_handler' : is not a member of 'std'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(58): error C2873: 'new_handler' : symbol cannot be used in a using-declaration
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxver_.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxv_w32.h
Note: including file: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winsdkver.h
Note: including file: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\windows.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\excpt.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdarg.h
Note: including file: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\windef.h
Note: including file: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(57): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(57): error C2143: syntax error : missing ';' before '*'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(57): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(59): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(59): error C2143: syntax error : missing ';' before '*'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(59): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(93): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(95): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(97): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(99): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(101): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(103): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(105): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(107): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(109): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(111): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(113): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(115): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(119): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(121): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(135): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(135): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(135): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(135): error C2491: 'iswalpha' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(135): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(136): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(136): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(136): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(136): error C2491: '_iswalpha_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(136): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(137): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(137): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(137): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(137): error C2491: 'iswupper' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(137): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(138): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(138): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(138): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(138): error C2491: '_iswupper_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(138): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(139): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(139): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(139): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(139): error C2491: 'iswlower' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(139): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(140): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(140): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(140): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(140): error C2491: '_iswlower_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(140): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(141): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(141): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(141): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(141): error C2491: 'iswdigit' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(141): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(142): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(142): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(142): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(142): error C2491: '_iswdigit_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(142): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(143): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(143): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(143): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(143): error C2491: 'iswxdigit' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(143): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(144): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(144): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(144): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(144): error C2491: '_iswxdigit_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(144): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(145): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(145): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(145): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(145): error C2491: 'iswspace' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(145): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(146): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(146): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(146): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(146): error C2491: '_iswspace_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(146): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(147): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(147): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(147): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(147): error C2491: 'iswpunct' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(147): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(148): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(148): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(148): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(148): error C2491: '_iswpunct_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(148): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(149): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(149): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(149): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(149): error C2491: 'iswalnum' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(149): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(150): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(150): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(150): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(150): error C2491: '_iswalnum_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(150): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(151): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(151): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(151): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(151): error C2491: 'iswprint' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(151): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(152): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(152): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(152): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(152): error C2491: '_iswprint_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(152): fatal error C1003: error count exceeds 100; stopping compilation
Build FAILED.
PS.: I'm not an expert developing whit c++ (I came from Java), I've started just a week ago.
EDIT:
I've commented the piece of code below, and i was able to build. The code was on stdafx.h, and I have no clue of what it mean, someone could explain it to me?
#if defined(_DEBUG) && !defined(_FULLDEBUG_)
#define _DEBUG_WAS_DEFINED
#undef _DEBUG
#pragma
message (" Compiling MFC header files in release mode.")
#endif
You should check your project properties for Debug and for Release configuration and see if you are missing something. I would start with Linker -> Input -> Additional Dependencies and C/C++ -> General -> Additional Include Directories.
I know this answer is a year late, but #pragma and message should be on the same line. Someone probably hit the enter key accidentally. This is why it works in release mode but not debug; _DEBUG is not defined in release configuration.
Visual Studio 2010 has a habit of giving you some weird error messages that should otherwise be straightforward parsing problems.