Can't compile boost/any_iterator.hpp in boost 1.57 - c++

After (attempting to) upgrade a VS2012 project to use boost 1.57, I can no longer compile--lots and lots of error messages coming out of boost/any_iterator.hpp (see below). As a test, I created a new project that contained nothing but an empty main function and #include "boost/any_iterator.hpp" and got the same set of errors. Here is the code it's complaining about:
// snippet from boost/any_iterator.hpp
template<
class Value
, class Traversal
, class Reference
, class Difference
, class Buffer
>
class postfix_increment_proxy<
range_detail::any_iterator< // line 131
Value
, Traversal
, Reference
, Difference
, Buffer
>
>
{
// ...
};
There is another class in the same file that follows the same pattern and generates identical errors. range_detail::any_iterator is forward-declared a little higher up in the file:
namespace range_detail
{
// ...
template<
class Value
, class Traversal
, class Reference
, class Difference
, class Buffer = any_iterator_default_buffer
>
class any_iterator;
// ...
}
For what it's worth, here's the set of errors I get from VS2012:
Error 1 error C2143: syntax error : missing ';' before '<' [path]\boost\range\detail\any_iterator.hpp 131
Error 2 error C2059: syntax error : '<' [path]\boost\range\detail\any_iterator.hpp 131
Error 3 error C2065: 'Value' : undeclared identifier [path]\boost\range\detail\any_iterator.hpp 134
Error 4 error C2065: 'Traversal' : undeclared identifier [path]\boost\range\detail\any_iterator.hpp 135
Error 5 error C2065: 'Reference' : undeclared identifier [path]\boost\range\detail\any_iterator.hpp 136
Error 6 error C2065: 'Difference' : undeclared identifier [path]\boost\range\detail\any_iterator.hpp 137
Error 7 error C2065: 'Buffer' : undeclared identifier [path]\boost\range\detail\any_iterator.hpp 138
Error 8 error C2923: 'boost::range_detail::any_iterator' : 'Value' is not a valid template type argument for parameter 'Value' [path]\boost\range\detail\any_iterator.hpp 138
Error 9 error C2923: 'boost::range_detail::any_iterator' : 'Traversal' is not a valid template type argument for parameter 'Traversal' [path]\boost\range\detail\any_iterator.hpp 138
Error 10 error C2923: 'boost::range_detail::any_iterator' : 'Reference' is not a valid template type argument for parameter 'Reference' [path]\boost\range\detail\any_iterator.hpp 138
Error 11 error C2923: 'boost::range_detail::any_iterator' : 'Difference' is not a valid template type argument for parameter 'Difference' [path]\boost\range\detail\any_iterator.hpp 138
Error 12 error C2923: 'boost::range_detail::any_iterator' : 'Buffer' is not a valid template type argument for parameter 'Buffer' [path]\boost\range\detail\any_iterator.hpp 138
Error 13 error C2143: syntax error : missing ';' before '{' [path]\boost\range\detail\any_iterator.hpp 140
Error 14 error C2447: '{' : missing function header (old-style formal list?) [path]\boost\range\detail\any_iterator.hpp 140
Is anyone aware of a workaround?

This appears to be a bug in the boost codebase. postfix_increment_proxy and writable_postfix_increment_proxy are both in the boost::iterators::detail namespace (iterator_facade.hpp). However, both names are used unqualified in any_iterator.hpp. Adding boost::iterators::detail:: in front of both names allows the code to compile.
For anyone who's uncomfortable with the idea of editing boost code, including iterator_facade.hpp followed by using namespace boost::iterators::detail followed by an include for any_iterator.hpp will also solve the problem at the cost of namespace pollution. VS2012 doesn't support them so it doesn't do me any good, but you could presumably use a C++11 using too.
Ticket submitted:
https://svn.boost.org/trac/boost/ticket/10754

Related

Intel pin and chrono conflicts

I try to measure the runtime of the program using Intel Pin. For this purpose I include chrono in my project. However It is not going to compile well. It gives a lot of errors. Furthermore, I tried to include chrono to many standart Intel Pin examples - the same result.
Could you please help me to solve errors below?
ratio(24,32): error C2143: syntax error: missing ',' before '<'
ratio(25): message : see reference to class template instantiation 'std::_Abs<_Val>' being compiled
ratio(30,38): error C2143: syntax error: missing ',' before '<'
ratio(31): message : see reference to class template instantiation 'std::_Safe_mult<_Ax,_Bx,_Sfinae,_Good>' being compiled
ratio(40,36): error C2143: syntax error: missing ',' before '<'
ratio(41): message : see reference to class template instantiation 'std::_Sign_of<_Val>' being compiled
ratio(45,38): error C2143: syntax error: missing ',' before '<'
ratio(46): message : see reference to class template instantiation 'std::_Safe_addX<_Ax,_Bx,_Good,_Also_good>' being compiled
ratio(50,44): error C2760: syntax error: unexpected token ',', expected 'expression'
ratio(51): message : see reference to class template instantiation 'std::_Safe_addX<_Ax,_Bx,false,false>' being compiled
ratio(65,41): error C2143: syntax error: missing ',' before '<'
ratio(66): message : see reference to class template instantiation 'std::_GcdX<_Ax,0>' being compiled
ratio(74,2): error C2504: 'integral_constant': base class undefined
ratio(74,38): error C2143: syntax error: missing ',' before '<'
ratio(158,5): error C2065: 'void_t': undeclared identifier
ratio(158,1): error C2226: syntax error: unexpected type 'std::_Ratio_multiply<_R1,_R2>::_Num::type'
ratio(159,1): error C2988: unrecognizable template declaration/definition
ratio(159,1): error C2059: syntax error: '>'
ratio(159,58): error C2143: syntax error: missing ';' before '{'
ratio(159,58): error C2447: '{': missing function header (old-style formal list?)
ratio(186,35): error C2143: syntax error: missing ',' before '<'
ratio(188): message : see reference to class template instantiation 'std::ratio_equal<_R1,_R2>' being compiled
ratio(195,39): error C2143: syntax error: missing ',' before '<'
ratio(197): message : see reference to class template instantiation 'std::ratio_not_equal<_R1,_R2>' being compiled
ratio(252,34): error C2143: syntax error: missing ',' before '<'
ratio(254): message : see reference to class template instantiation 'std::ratio_less<_R1,_R2>' being compiled
ratio(261,40): error C2143: syntax error: missing ',' before '<'
ratio(263): message : see reference to class template instantiation 'std::ratio_less_equal<_R1,_R2>' being compiled
ratio(279,43): error C2143: syntax error: missing ',' before '<'
ratio(282): message : see reference to class template instantiation 'std::ratio_greater_equal<_R1,_R2>' being compiled
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt.h(512,39): error C2371: 'wint_t': redefinition; different basic types
1>E:\Tools\source\pin\extras\crt\include\wchar.h(52): message : see declaration of 'wint_t'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt.h(513,39): error C2371: 'wctype_t': redefinition; different basic types
1>E:\Tools\source\pin\extras\crt\include\wchar.h(77): message : see declaration of 'wctype_t'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt.h(538,19): error C2371: 'mbstate_t': redefinition; different basic types
1>E:\Tools\source\pin\extras\crt\include\wchar.h(58): message : see declaration of 'mbstate_t'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt.h(552,28): error C2371: 'time_t': redefinition; different basic types
1>E:\Tools\source\pin\extras\crt\include\sys\types.h(91): message : see declaration of 'time_t'
vcruntime_new.h(34,26): error C2011: 'std::nothrow_t': 'struct' type redefinition
1>E:\Tools\source\pin\extras\libstdc++\include\new(10): message : see declaration of 'std::nothrow_t'
vcruntime_new.h(168,5): error C2084: function 'void *operator new(size_t,void *)' already has a body
1>E:\Tools\source\pin\extras\libstdc++\include\new(36): message : see previous definition of 'new'
vcruntime_new.h(174,5): error C2084: function 'void operator delete(void *,void *) throw()' already has a body
1>E:\Tools\source\pin\extras\libstdc++\include\new(40): message : see previous definition of 'delete'
vcruntime_new.h(184,5): error C2084: function 'void *operator new[](size_t,void *)' already has a body
1>E:\Tools\source\pin\extras\libstdc++\include\new(37): message : see previous definition of 'new[]'
vcruntime_new.h(190,5): error C2084: function 'void operator delete[](void *,void *) throw()' already has a body
1>E:\Tools\source\pin\extras\libstdc++\include\new(41): message : see previous definition of 'delete[]'
xtimec.h(28,15): error C2144: syntax error: 'int' should be preceded by ';'
xtimec.h(28,19): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
xtimec.h(30,15): error C2144: syntax error: 'long' should be preceded by ';'
xtimec.h(30,20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
xtimec.h(30,1): error C2086: 'int _CRTIMP2': redefinition
xtimec.h(28): message : see declaration of '_CRTIMP2'
xtimec.h(31,15): error C2144: syntax error: 'long' should be preceded by ';'
xtimec.h(31,20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
xtimec.h(31,1): error C2086: 'int _CRTIMP2': redefinition
xtimec.h(28): message : see declaration of '_CRTIMP2'
xtimec.h(32,15): error C2144: syntax error: '__int64' should be preceded by ';'
xtimec.h(32,25): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
xtimec.h(32,1): error C2086: 'int _CRTIMP2': redefinition
xtimec.h(28): message : see declaration of '_CRTIMP2'
xtimec.h(36,15): error C2144: syntax error: '__int64' should be preceded by ';'
xtimec.h(36,25): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
xtimec.h(36,1): error C2086: 'int _CRTIMP2': redefinition
xtimec.h(28): message : see declaration of '_CRTIMP2'
xtimec.h(37,15): error C2144: syntax error: '__int64' should be preceded by ';'
xtimec.h(37,25): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
xtimec.h(37,1): error C2086: 'int _CRTIMP2': redefinition
xtimec.h(28): message : see declaration of '_CRTIMP2'
chrono(28,55): error C2143: syntax error: missing ',' before '<'
chrono(29): message : see reference to class template instantiation 'std::chrono::treat_as_floating_point<_Rep>' being compiled
chrono(96,43): error C2143: syntax error: missing ';' before '<'
chrono(171): message : see reference to class template instantiation 'std::chrono::duration<_Rep,_Period>' being compiled
chrono(96,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
chrono(96,30): error C2126: 'std::chrono::duration<_Rep,_Period>::common_type_t' cannot be declared with 'constexpr' specifier
chrono(96,1): warning C4869: 'nodiscard' may only be applied to classes, enumerations, and functions
chrono(97,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
chrono(101,43): error C2143: syntax error: missing ';' before '<'
chrono(101,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
chrono(101,30): error C2126: 'std::chrono::duration<_Rep,_Period>::common_type_t' cannot be declared with 'constexpr' specifier
chrono(101,1): warning C4869: 'nodiscard' may only be applied to classes, enumerations, and functions
chrono(102,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
chrono(223,24): error C2143: syntax error: missing ',' before '<'
chrono(224): message : see reference to class template instantiation 'std::_Lcm<_Ax,_Bx>' being compiled
chrono(228,19): error C2988: unrecognizable template declaration/definition
chrono(228,19): error C2143: syntax error: missing ';' before '<'
chrono(228,19): error C2059: syntax error: '<'
chrono(228,37): error C2065: '_Rep1': undeclared identifier
chrono(228,44): error C2065: '_Period1': undeclared identifier
chrono(228,28): error C2923: 'std::chrono::duration': '_Rep1' is not a valid template type argument for parameter '_Rep'
chrono(228,28): error C2923: 'std::chrono::duration': '_Period1' is not a valid template type argument for parameter '_Period'
chrono(229,22): error C2065: '_Rep2': undeclared identifier
chrono(229,29): error C2065: '_Period2': undeclared identifier
chrono(229,13): error C2923: 'std::chrono::duration': '_Rep2' is not a valid template type argument for parameter '_Rep'
chrono(229,13): error C2923: 'std::chrono::duration': '_Period2' is not a valid template type argument for parameter '_Period'
chrono(229,40): error C2143: syntax error: missing ';' before '{'
chrono(229,40): error C2447: '{': missing function header (old-style formal list?)
chrono(235,8): error C2976: 'std::common_type': too few template arguments
chrono(228): message : see declaration of 'std::common_type'
chrono(238,2): error C2976: 'std::common_type': too few template arguments
chrono(236): message : see declaration of 'std::common_type'
chrono(243,39): error C2988: unrecognizable template declaration/definition
chrono(243,39): error C2143: syntax error: missing ';' before '<'
chrono(243,16): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
chrono(243,39): error C2059: syntax error: '<'
chrono(243,49): error C2065: '_Rep1': undeclared identifier
chrono(243,56): error C2065: '_Period1': undeclared identifier
chrono(243,40): error C2923: 'std::chrono::duration': '_Rep1' is not a valid template type argument for parameter '_Rep'
chrono(243,40): error C2923: 'std::chrono::duration': '_Period1' is not a valid template type argument for parameter '_Period'
chrono(243,76): error C2065: '_Rep2': undeclared identifier
chrono(243,83): error C2065: '_Period2': undeclared identifier
chrono(243,67): error C2923: 'std::chrono::duration': '_Rep2' is not a valid template type argument for parameter '_Rep'
chrono(243,67): error C2923: 'std::chrono::duration': '_Period2' is not a valid template type argument for parameter '_Period'
chrono(244,34): error C2065: '_Rep1': undeclared identifier
chrono(244,41): error C2065: '_Period1': undeclared identifier
chrono(244,25): error C2923: 'std::chrono::duration': '_Rep1' is not a valid template type argument for parameter '_Rep'
chrono(244,25): error C2923: 'std::chrono::duration': '_Period1' is not a valid template type argument for parameter '_Period'
chrono(244,74): error C2065: '_Rep2': undeclared identifier
chrono(244,81): error C2065: '_Period2': undeclared identifier
chrono(244,65): error C2923: 'std::chrono::duration': '_Rep2' is not a valid template type argument for parameter '_Rep'
chrono(244,65): error C2923: 'std::chrono::duration': '_Period2' is not a valid template type argument for parameter '_Period'
chrono(245,81): error C2143: syntax error: missing ';' before '{'
chrono(245,81): error C2447: '{': missing function header (old-style formal list?)
chrono(251,39): error C2988: unrecognizable template declaration/definition
chrono(251,39): error C2143: syntax error: missing ';' before '<'
chrono(251,16): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
chrono(251,26): error C2374: 'std::chrono::common_type_t': redefinition; multiple initialization
chrono(243): message : see declaration of 'std::chrono::common_type_t'
chrono(251,39): error C2059: syntax error: '<'
chrono(251,49): error C2065: '_Rep1': undeclared identifier
chrono(251,56): error C2065: '_Period1': undeclared identifier
chrono(251,40): error C2923: 'std::chrono::duration': '_Rep1' is not a valid template type argument for parameter '_Rep'
chrono(251,40): error C2923: 'std::chrono::duration': '_Period1' is not a valid template type argument for parameter '_Period'
chrono(251,76): error C2065: '_Rep2': undeclared identifier
chrono(251,83): error C2065: '_Period2': undeclared identifier
chrono(251,67): error C2923: 'std::chrono::duration': '_Rep2' is not a valid template type argument for parameter '_Rep'
chrono(251,67): error C2923: 'std::chrono::duration': '_Period2' is not a valid template type argument for parameter '_Period'
chrono(252,34): error C2065: '_Rep1': undeclared identifier
chrono(252,41): error C2065: '_Period1': undeclared identifier
chrono(252,25): error C2923: 'std::chrono::duration': '_Rep1' is not a valid template type argument for parameter '_Rep'
chrono(252,25): error C2923: 'std::chrono::duration': '_Period1' is not a valid template type argument for parameter '_Period'
chrono(252,74): error C2065: '_Rep2': undeclared identifier
chrono(252,81): error C2065: '_Period2': undeclared identifier
chrono(252,1): fatal error C1003: error count exceeds 100; stopping compilation

Getting string compile errors in visual studio using the boost string lib

i am trying to make a program that reads from an ini file but in Visual Studio I keep getting compile errors about string identifiers and semicolons in the wrong place. I am not very good at C++ so it's most likely something really simple, but any way here is the code and error list.
INI.h
#ifndef INI_H
#define INI_H
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ini_parser.hpp>
#include <boost/algorithm/string.hpp>
#include <iostream>
string INIreader(const string&, const string&);
#endif
INI_readnwrite.cpp
#include "INI.h"
using boost::property_tree::ptree;
string INIreader(const string& section, const string& name)
{
ptree pt;
read_ini("GameSettings.ini", pt);
string value = pt.get<string>("section.name");
return value;
}
mainCode.cpp
#include "INI.h"
using namespace std;
int main()
{
string sec = "gameSettings";
string val = "resXY";
cout << INIreader(sec, val);
}
And here is the error list
error// file// line//
error C2872: 'string' : ambiguous symbol maincode.cpp 18
error C2146: syntax error : missing ';' before identifier 'sec' maincode.cpp 18
error C2065: 'sec' : undeclared identifier maincode.cpp 18
error C2872: 'string' : ambiguous symbol maincode.cpp 19
error C2146: syntax error : missing ';' before identifier 'val' maincode.cpp 19
error C2065: 'val' : undeclared identifier maincode.cpp 19
error C2065: 'val' : undeclared identifier maincode.cpp 20
error C2065: 'sec' : undeclared identifier maincode.cpp 20
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ini_readnwrite.cpp 6
error C2872: 'string' : ambiguous symbol ini_readnwrite.cpp 6
error C2146: syntax error : missing ';' before identifier 'INIreader' ini_readnwrite.cpp 6
error C2143: syntax error : missing ',' before '&' ini_readnwrite.cpp 6
error C2086: 'int string' : redefinition ini_readnwrite.cpp 6
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ini_readnwrite.cpp 7
error C2974: 'boost::property_tree::basic_ptree<std::string,std::string,std::less<Key>>::get' : invalid template argument for 'Type', type expected ini_readnwrite.cpp 10
error C2974: 'boost::property_tree::basic_ptree<std::string,std::string,std::less<Key>>::get' : invalid template argument for 'Ch', type expected ini_readnwrite.cpp 10
error C2146: syntax error : missing ';' before identifier 'value' ini_readnwrite.cpp 10
error C2065: 'value' : undeclared identifier ini_readnwrite.cpp 10
error C2065: 'value' : undeclared identifier ini_readnwrite.cpp 11
IntelliSense: identifier "string" is undefined INI.h 9
IntelliSense: identifier "string" is undefined INI.h 9
IntelliSense: identifier "string" is undefined INI.h 9
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ini.h 9
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ini.h 9
error C2146: syntax error : missing ';' before identifier 'INIreader' ini.h 9
error C2146: syntax error : missing ';' before identifier 'INIreader' ini.h 9
error C2143: syntax error : missing ',' before '&' ini.h 9
error C2143: syntax error : missing ',' before '&' ini.h 9
Thanks.
You need to use the fully qualified name when you attempt to use std::string in your header file:
std::string INIreader(const std::string&, const std::string&);
And do the same thing in INI_readnwrite.cpp, or add a "using" directive like you did in the other .cpp file:
using boost::property_tree::ptree;
using namespace std;

How to find the "real" error?

I am having an enormous amount of errors showing up in the error list of the program, but none of the ones listed seem to be "real" errors. Some of the lines are red and then when I go to highlight over them the error disappears. I just can't seem to find where my error really is. What is the best process to go through to find my mistake?
Below is the error list in case that is helpful.
Error 38 error C1004: unexpected end-of-file found 85
Error 68 error C1004: unexpected end-of-file found 42
Error 63 error C1903: unable to recover from previous error(s); stopping compilation 72
Error 66 error C2059: syntax error : ')' 42
Error 2 error C2059: syntax error : '>' 80
Error 40 error C2059: syntax error : '>' 80
Error 65 error C2059: syntax error : '>' 42
Error 20 error C2065: '_Ptr_cerr' : undeclared identifier 27
Error 16 error C2065: '_Ptr_cin' : undeclared identifier 25
Error 22 error C2065: '_Ptr_clog' : undeclared identifier 28
Error 18 error C2065: '_Ptr_cout' : undeclared identifier 26
Error 28 error C2065: '_Ptr_wcerr' : undeclared identifier 32
Error 24 error C2065: '_Ptr_wcin' : undeclared identifier 30
Error 30 error C2065: '_Ptr_wclog' : undeclared identifier 33
Error 26 error C2065: '_Ptr_wcout' : undeclared identifier 31
Error 4 error C2065: 'faction' : undeclared identifier 84
Error 42 error C2065: 'faction' : undeclared identifier 84
Error 64 error C2065: 'Faction' : undeclared identifier 42
Error 13 error C2065: 'socialite' : undeclared identifier 100
Error 51 error C2065: 'socialite' : undeclared identifier 100
Error 1 error C2065: 'Socialite' : undeclared identifier 80
Error 12 error C2065: 'Socialite' : undeclared identifier 100
Error 39 error C2065: 'Socialite' : undeclared identifier 80
Error 50 error C2065: 'Socialite' : undeclared identifier 100
Error 8 error C2065: 'textWriter' : undeclared identifier 82
Error 46 error C2065: 'textWriter' : undeclared identifier 82
Error 6 error C2143: syntax error : missing ',' before ')' 84
Error 10 error C2143: syntax error : missing ',' before ')' 82
Error 14 error C2143: syntax error : missing ',' before ')' 100
Error 44 error C2143: syntax error : missing ',' before ')' 84
Error 48 error C2143: syntax error : missing ',' before ')' 82
Error 52 error C2143: syntax error : missing ',' before ')' 100
Error 17 error C2143: syntax error : missing ',' before ';' 25
Error 19 error C2143: syntax error : missing ',' before ';' 26
Error 21 error C2143: syntax error : missing ',' before ';' 27
Error 23 error C2143: syntax error : missing ',' before ';' 28
Error 25 error C2143: syntax error : missing ',' before ';' 30
Error 27 error C2143: syntax error : missing ',' before ';' 31
Error 29 error C2143: syntax error : missing ',' before ';' 32
Error 31 error C2143: syntax error : missing ',' before ';' 33
Error 7 error C2143: syntax error : missing ';' before '{' 32
Error 15 error C2143: syntax error : missing ';' before '{' 10
Error 32 error C2143: syntax error : missing ';' before '{' 36
Error 35 error C2143: syntax error : missing ';' before '{' 27
Error 45 error C2143: syntax error : missing ';' before '{' 32
Error 54 error C2143: syntax error : missing ';' before '{' 34
Error 57 error C2143: syntax error : missing ';' before '{' 48
Error 60 error C2143: syntax error : missing ';' before '{' 61
Error 3 error C2143: syntax error : missing ';' before '}' 82
Error 11 error C2143: syntax error : missing ';' before '}' 98
Error 33 error C2143: syntax error : missing ';' before '}' 42
Error 34 error C2143: syntax error : missing ';' before '}' 45
Error 36 error C2143: syntax error : missing ';' before '}' 83
Error 37 error C2143: syntax error : missing ';' before '}' 85
Error 41 error C2143: syntax error : missing ';' before '}' 82
Error 49 error C2143: syntax error : missing ';' before '}' 98
Error 55 error C2143: syntax error : missing ';' before '}' 43
Error 58 error C2143: syntax error : missing ';' before '}' 57
Error 61 error C2143: syntax error : missing ';' before '}' 69
Error 67 error C2143: syntax error : missing ';' before '}' 42
Error 5 error C2275: 'Faction' : illegal use of this type as an expression 84
Error 43 error C2275: 'Faction' : illegal use of this type as an expression 84
Error 9 error C2275: 'std::ofstream' : illegal use of this type as an expression 82
Error 47 error C2275: 'std::ofstream' : illegal use of this type as an expression 82
Error 53 error C2653: 'Socialite' : is not a class or namespace name 33
Error 56 error C2653: 'Socialite' : is not a class or namespace name 46
Error 59 error C2653: 'Socialite' : is not a class or namespace name 60
Error 62 error C2653: 'Socialite' : is not a class or namespace name 72
Probably a missing ; after the closing } of a class / struct. Could you post some code?
UPDATE: The code compiles now on my gcc. The problem I found is that you have a circular dependency between your classes. So solve this, forward declare some of them in the headers. I added class Faction; before class Socialite in Socialite.h and class Socialite; before class Faction in Faction.h.
Unexpected end of file is usually that you are missing a closing "something", such as a bracket } or parenthesis )
It's either a missing #endif or a ; at the end of a type definition or possibly a missing } at the end of a function.
Start with the first error reported. Often it's the cause of a lot of the subsequent problems because the first error causes the parser to be out of sync with the rest of the code.
In C++, long cascades of errors are often caused by an undeclared type (did you forget an include file?) or by a missing ; after a class or struct definition.
Consider:
Foobar fb; // Declare an instance of Foobar.
If Foobar hasn't been declared yet (perhaps because you forgot to include "foobar.h"), then the compiler might think you're trying to declare a variable named Foobar with a default type of int. From there, it sees the fb and gets all confused.
Or consider:
struct Foobar {
int x;
int y;
}
int blah = 0;
Without the ; after the struct definition, the parser thinks you're trying to declare an instance of Foobar named int, which isn't allowed since int is a reserved keyword. And everything after that looks like gobbledegook to the compiler.
One trick is to temporarily #if 0-out all the code after the line with the first reported error, as that will reduce the noise until you isolate the original problem.
If you look at the "Error List" window (View > Error List) it can be really hard to figure out where the errors originate. Luckily, there's another way:
Open the "Output" window (Debug > Windows > Output)
Compile and build
Start at the top of the "Output" window and work your way down the compiler/linker output text until you come to the first line that says "error"
This will usually lead you right to the problem.

Generate working Onvif code with wsdl2cpp

I generated the DeviceMgmt stub from cmd with
WSDL2CPP.bat -uri http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl -u -d adb -o OutputDirectory
The first time, I got an error like "No service was found" and I solved it by adding this:
<wsdl:service name="OnvifService">
<wsdl:port name="OnvifEndpoint" binding="DeviceBinding">
<soap:address location="http://www.onvif.org/ver10/device/wsdl"/>
</wsdl:port>
</wsdl:service>
in devicemgmt.wsdl
I opened the generated project in VS2012 and set the project configuration type to dynamic library. After I compiled it I got a lot of errors like:
Error 907 error C2065: 'element' : undeclared identifier d:\projects\onvif\devicemgmtservice\src\unsupportedpolicyrequestfaulttype.cpp 878
Error 1725 error C2143: syntax error : missing ';' before '*' d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.h 46
Error 1726 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.h 46
Error 1731 error C2061: syntax error : identifier 'axutil_duration_t' d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.h 206
Error 2872 error C2143: syntax error : missing ';' before '*' d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.h 46
Error 2873 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.h 46 error C2660: 'axutil_base64_binary_set_encoded_binary' : function does not take 1 arguments d:\projects\onvif\devicemgmtservice\src\motionincells.cpp 343
Error 4114 error C2059: syntax error : ')' d:\projects\onvif\devicemgmtservice\src\motionincells.cpp 344
Error 4256 error C2065: 'cp' : undeclared identifier d:\projects\onvif\devicemgmtservice\src\messagetypes_type0.cpp 81
Error 4257 error C2065: 'cp' : undeclared identifier d:\projects\onvif\devicemgmtservice\src\messagetypes_type0.cpp 83
Error 4258 error C2065: 'cp' : undeclared identifier d:\projects\onvif\devicemgmtservice\src\messagetypes_type0.cpp 85
Error 4259 error C2065: 'cp' : undeclared identifier d:\projects\onvif\devicemgmtservice\src\messagetypes_type0.cpp 86
Error 4260 error C2065: 'cp' : undeclared identifier d:\projects\onvif\devicemgmtservice\src\messagetypes_type0.cpp 100
Error 4261 error C2065: 'cp' : undeclared identifier d:\projects\onvif\devicemgmtservice\src\messagetypes_type0.cpp 108
Error 4262 error C2664: 'axutil_qname_free' : cannot convert parameter 1 from 'void *' to 'axutil_qname *' d:\projects\onvif\devicemgmtservice\src\messagetypes_type0.cpp 416
Error 4695 error C2065: 'element' : undeclared identifier d:\projects\onvif\devicemgmtservice\src\invalidfilterfaulttype.cpp 878
Error 6379 error C2065: 'env' : undeclared identifier d:\projects\onvif\devicemgmtservice\src\attributedqnametype.cpp 88
Error 6380 error C2227: left of '->allocator' must point to class/struct/union/generic type d:\projects\onvif\devicemgmtservice\src\attributedqnametype.cpp 88
Error 6381 error C2227: left of '->malloc_fn' must point to class/struct/union/generic type d:\projects\onvif\devicemgmtservice\src\attributedqnametype.cpp 88
Error 6382 error C2065: 'prefix' : undeclared identifier d:\projects\onvif\devicemgmtservice\src\attributedqnametype.cpp 89
Error 6383 error C2065: 'prefix' : undeclared identifier d:\projects\onvif\devicemgmtservice\src\attributedqnametype.cpp 90
Error 6518 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.h 46
Error 6523 error C2061: syntax error : identifier 'axutil_duration_t' d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.h 206
Error 6524 error C3861: 'axutil_duration_create_from_string': identifier not found d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp 132
Error 6525 error C2039: '_duration' : is not a member of 'org_xmlsoap_schemas_soap_envelope::AbsoluteOrRelativeTimeType::<unnamed-type-memberType>' d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp 229
Error 6526 error C3861: 'axutil_duration_serialize_duration': identifier not found d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp 229
Error 6527 error C2143: syntax error : missing ';' before '*' d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp 437
Error 6528 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp 437
Error 6529 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp 439
Error 6530 error C2039: '_duration' : is not a member of 'org_xmlsoap_schemas_soap_envelope::AbsoluteOrRelativeTimeType::<unnamed-type-memberType>' d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp 442
Error 6531 error C2059: syntax error : ')' d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp 444
Error 6532 error C2065: 'member_type' : undeclared identifier d:\projects\onvif\devicemgmtservice\src\absoluteorrelativetimetype.cpp 448
Error 6539 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_registry.h 65
Error 6540 error C2061: syntax error : identifier 'neethi_operator_t' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_assertion.h 179
Error 6541 error C2143: syntax error : missing ';' before '*' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 58
Error 6542 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 58
Error 6543 error C2086: 'int neethi_policy_t' : redefinition d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 58
Error 6544 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 62
Error 6545 error C2143: syntax error : missing ';' before '*' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 79
Error 6546 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 79
Error 6547 error C2086: 'int neethi_policy_t' : redefinition d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 79
Error 6548 error C2061: syntax error : identifier 'neethi_policy_t' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 83
Error 6549 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 83
Error 6550 error C2143: syntax error : missing ';' before '*' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 103
Error 6551 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 103
Error 6552 error C2086: 'int neethi_policy_t' : redefinition d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 103
Error 6553 error C2061: syntax error : identifier 'neethi_policy_t' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 106
Error 6554 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 108
Error 6555 error C2143: syntax error : missing ';' before '*' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 122
Error 6556 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 122
Error 6557 error C2086: 'int neethi_policy_t' : redefinition d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 122
Error 6558 error C2061: syntax error : identifier 'neethi_policy_t' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 125
Error 6559 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 126
Error 6560 error C2065: 'policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 136
Error 6561 error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_engine.h 137
Error 6562 error C2143: syntax error : missing ';' before '*' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h 38
Error 6563 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h 38
Error 6564 error C2086: 'int neethi_policy_t' : redefinition d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h 38
Error 6565 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h 41
Error 6566 error C2143: syntax error : missing ';' before '*' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h 43
Error 6567 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h 43
Error 6568 error C2086: 'int neethi_policy_t' : redefinition d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h 43
Error 6569 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_util.h 46
Error 6570 error C2143: syntax error : missing ';' before '*' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethipolicy.h 53
Error 6571 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethipolicy.h 53
Error 6572 error C2143: syntax error : missing ';' before '*' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethipolicy.h 60
Error 6573 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethipolicy.h 60
Error 6575 error C2061: syntax error : identifier 'neethi_policy_t' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethipolicy.h 66
Error 6576 error C2143: syntax error : missing ';' before '*' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\serviceclient.h 84
Error 6577 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\serviceclient.h 84
Error 6586 error C2143: syntax error : missing ';' before '*' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\serviceclient.h 386
Error 6587 error C2071: 'wso2wsf::ServiceClient::axis2_svc_client_t' : illegal storage class d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\serviceclient.h 386
Error 6588 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\serviceclient.h 386
Error 6590 error C2378: 'neethi_policy_t' : redefinition; symbol cannot be overloaded with a typedef d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 38
Error 6591 error C2143: syntax error : missing ';' before '*' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 40
Error 6592 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 40
Error 6593 error C2086: 'int neethi_policy_t' : redefinition d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 40
Error 6594 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 42
Error 6595 error C2065: 'neethi_policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 46
Error 6596 error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 47
Error 6597 error C2065: 'neethi_policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 51
Error 6598 error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 52
Error 6599 error C2065: 'neethi_policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 56
Error 6600 error C2065: 'arraylist' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 57
Error 6601 error C2275: 'axutil_array_list_t' : illegal use of this type as an expression d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 57
Error 6602 error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 58
Error 6603 error C2065: 'neethi_policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 62
Error 6604 error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 63
Error 6605 error C2065: 'neethi_policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 68
Error 6606 error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 69
Error 6607 error C2065: 'normalized_neethi_policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 73
Error 6608 error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 74
Error 6609 error C2065: 'neethi_policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 78
Error 6610 error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 79
Error 6611 error C2065: 'neethi_policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 83
Error 6612 error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 84
Error 6613 error C2065: 'neethi_policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 88
Error 6614 error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 89
Error 6615 error C2065: 'neethi_policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 94
Error 6616 error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 95
Error 6617 error C2065: 'neethi_policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 99
Error 6618 error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 100
Error 6619 error C2065: 'neethi_policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 105
Error 6620 error C2065: 'parent' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 106
Error 6621 error C2275: 'axiom_node_t' : illegal use of this type as an expression d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 106
Error 6622 error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 107
Error 6623 error C2065: 'policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 111
Error 6624 error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 112
Error 6625 error C2065: 'neethi_policy' : undeclared identifier d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 117
Error 6626 error C2059: syntax error : 'const' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\neethi_policy.h 118
Error 6627 error C2061: syntax error : identifier 'neethi_policy_t' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\axis2_svc_client.h 602
Error 6628 error C2061: syntax error : identifier 'neethi_policy_t' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\axis2_policy_include.h 110
Error 6629 error C2061: syntax error : identifier 'neethi_policy_t' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\axis2_policy_include.h 117
Error 6630 error C2061: syntax error : identifier 'neethi_policy_t' d:\wso\wso2-wsf-cpp-bin-2.1.0-win32\wso2-wsf-cpp-bin-2.1.0-win32\include\axis2_policy_include.h 124
Error 6631 error C2143: syntax error : missing ';' before '*' d:\wso\wso2-
Has someone generated working code for Onvif using WSO2? What am I doing wrong?
Have not tried using WSO2, but have used svcutil.exe.
I added my client proxy using Visual Studio 2012,
Add new Project, new ClassLibrary
in solution explorer use the add new service reference context menu
In the address, use url to the wsdl http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl
Clik Go
Select an apropiate name, like OnvifDeviceService.
Clik Ok
This will auto generate the proxy for you.
Mind that Onvif is using Soap12, so basicHttpBinding is out the window as this uses Soap1.1.
Use a WsHttpBinding or a custom binding to connect to your device.
Use the built in method for scanning for devices.
Add a reference to System.ServiceModel.Discovery assembly, and this code will scan your network for devices. Some filtering for onvif devices must be implemented.
private FindResponse ScanNetwork(string scopeMathcBy, int iTimeoutMilliseconds)
{
ServicePointManager.Expect100Continue = false;
UdpDiscoveryEndpoint oUdpDiscoveryEndpoint = new UdpDiscoveryEndpoint(DiscoveryVersion.WSDiscoveryApril2005);
DiscoveryClient oDiscoveryClient = new DiscoveryClient(oUdpDiscoveryEndpoint);
// Create FindCriteria
var findCriteria = new FindCriteria
{
Duration = TimeSpan.FromMilliseconds(iTimeoutMilliseconds)
};
if (scopeMathcBy != null)
{
findCriteria.ScopeMatchBy = new Uri(scopeMathcBy);
}
var findResponse = oDiscoveryClient.Find(findCriteria);
return findResponse;
}
Solved! The problem was in include order. I have rearranged #include directives and i added some includes were needed. But there where still 2 error that was easily removed just looking in the generated code.

async_write method error

void Chat::Send(uint8_t* buffer, int length){
boost::asio::async_write(socket_,boost::asio::buffer(buffer,length),
boost::bind(&Chat:Send, this,boost::asio::placeholders::error));
}
it should work like this tutorial. But when I try to build the project I get the following errors
Error 1 error C2825: 'F': must be a class or namespace when followed by '::' e:\boost_1_46_1\boost_1_46_1\boost\bind\bind.hpp 69
Error 2 error C2039: 'result_type' : is not a member of '`global namespace'' e:\boost_1_46_1\boost_1_46_1\boost\bind\bind.hpp 69
Error 3 error C2146: syntax error : missing ';' before identifier 'type' e:\boost_1_46_1\boost_1_46_1\boost\bind\bind.hpp 69
Error 4 error C2208: 'boost::_bi::type' : no members defined using this type e:\boost_1_46_1\boost_1_46_1\boost\bind\bind.hpp 69
Error 5 error C1903: unable to recover from previous error(s); stopping compilation e:\boost_1_46_1\boost_1_46_1\boost\bind\bind.hpp 69
I am not even using 'F' why it's keep saying 'F': must be a class or namespace when followed by '::'?
boost::bind(&Chat:Send, this,boost::asio::placeholders::error));
^^^^^^
should be
boost::bind(&Chat::Send, this,boost::asio::placeholders::error));
^^^^^^
note the scope resolution operator for class Chat. The compiler errors that can be encountered when using boost::bind are very confusing.