IntelliSense: identifier "IDXGISwapChain1" is undefined - c++

I have saved a captured frame using NVIDIA Nsight and when I open the saved solution file I get the following itellisense error:
IntelliSense: identifier "IDXGISwapChain1" is undefined [..]
I have made no changes to the solution.
I also get the follow errors when building (using VS2013):
Error 1 error C2143: syntax error : missing ';' before '' c:\users[...]\documents\nvidia nsight\captures\build11__2015_06_20__15_15_15\Resources.h 27 1 build11__2015_06_20__15_15_15
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users[...]\documents\nvidia nsight\captures\build11__2015_06_20__15_15_15\Resources.h 27 1 build11__2015_06_20__15_15_15
Error 3 error C2143: syntax error : missing ';' before '' c:\users[...]\documents\nvidia nsight\captures\build11__2015_06_20__15_15_15\Resources.h 27 1 build11__2015_06_20__15_15_15
Error 4 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users[...]\documents\nvidia nsight\captures\build11__2015_06_20__15_15_15\Resources.h 27 1 build11__2015_06_20__15_15_15
Error 5 error C2143: syntax error : missing ';' before '' c:\users[...]\documents\nvidia nsight\captures\build11__2015_06_20__15_15_15\Resources.h 27 1 build11__2015_06_20__15_15_15
Error 6 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users[...]\documents\nvidia nsight\captures\build11__2015_06_20__15_15_15\Resources.h 27 1 build11__2015_06_20__15_15_15
Error 7 error C2143: syntax error : missing ';' before '' c:\users[...]\documents\nvidia nsight\captures\build11__2015_06_20__15_15_15\Resources.h 27 1 build11__2015_06_20__15_15_15
Error 8 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users[...]\documents\nvidia nsight\captures\build11__2015_06_20__15_15_15\Resources.h 27 1 build11__2015_06_20__15_15_15
Error 9 error C2143: syntax error : missing ';' before '' c:\users[...]\documents\nvidia nsight\captures\build11__2015_06_20__15_15_15\Resources.h 27 1 build11__2015_06_20__15_15_15
Error 10 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users[...]\documents\nvidia nsight\captures\build11__2015_06_20__15_15_15\Resources.h 27 1 build11__2015_06_20__15_15_15
Error 11 error C2146: syntax error : missing ';' before identifier 'DXGI_SWAP_CHAIN_DESC1_temp_1' C:\Users[...]\Documents\NVIDIA Nsight\Captures\build11__2015_06_20__15_15_15\Resources00.cpp 88 1 build11__2015_06_20__15_15_15
Error 12 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Users[...]\Documents\NVIDIA Nsight\Captures\build11__2015_06_20__15_15_15\Resources00.cpp 88 1 build11__2015_06_20__15_15_15
Error 13 error C2065: 'DXGI_SWAP_CHAIN_DESC1_temp_1' : undeclared identifier C:\Users[...]\Documents\NVIDIA Nsight\Captures\build11__2015_06_20__15_15_15\Resources00.cpp 88 1 build11__2015_06_20__15_15_15
Error 14 error C2146: syntax error : missing ';' before identifier 'DXGI_SWAP_CHAIN_FULLSCREEN_DESC_temp_1' C:\Users[...]\Documents\NVIDIA Nsight\Captures\build11__2015_06_20__15_15_15\Resources00.cpp 89 1 build11__2015_06_20__15_15_15
Error 15 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Users[...]\Documents\NVIDIA Nsight\Captures\build11__2015_06_20__15_15_15\Resources00.cpp 89 1 build11__2015_06_20__15_15_15
Error 16 error C2065: 'DXGI_SWAP_CHAIN_FULLSCREEN_DESC_temp_1' : undeclared identifier C:\Users[...]\Documents\NVIDIA Nsight\Captures\build11__2015_06_20__15_15_15\Resources00.cpp 89 1 build11__2015_06_20__15_15_15
Error 17 error C2065: 'IDXGIFactory2' : undeclared identifier C:\Users[...]\Documents\NVIDIA Nsight\Captures\build11__2015_06_20__15_15_15\Resources00.cpp 90 1 build11__2015_06_20__15_15_15
Error 18 error C2059: syntax error : ')' C:\Users[...]\Documents\NVIDIA Nsight\Captures\build11__2015_06_20__15_15_15\Resources00.cpp 90 1 build11__2015_06_20__15_15_15
Error 19 error C2227: left of '->Release' must point to class/struct/union/generic type C:\Users[...]\Documents\NVIDIA Nsight\Captures\build11__2015_06_20__15_15_15\Resources00.cpp 727 1 build11__2015_06_20__15_15_15
Error 20 error C2143: syntax error : missing ';' before '' C:\Users[...]\Documents\NVIDIA Nsight\Captures\build11__2015_06_20__15_15_15\Resources00.cpp 771 1 build11__2015_06_20__15_15_15
Error 21 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Users[...]\Documents\NVIDIA Nsight\Captures\build11__2015_06_20__15_15_15\Resources00.cpp 771 1 build11__2015_06_20__15_15_15
Error 22 error C2086: 'int pIDXGISwapChain1_uidof_68' : redefinition C:\Users[...]\Documents\NVIDIA Nsight\Captures\build11__2015_06_20__15_15_15\Resources00.cpp 771 1 build11__2015_06_20__15_15_15
Error 23 error C2143: syntax error : missing ';' before '' c:\users[...]\documents\nvidia nsight\captures\build11__2015_06_20__15_15_15\Resources.h 27 1 build11__2015_06_20__15_15_15
Error 24 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\users[...]\documents\nvidia nsight\captures\build11__2015_06_20__15_15_15\Resources.h 27 1 build11__2015_06_20__15_15_15
25 IntelliSense: identifier "IDXGISwapChain1" is undefined c:\Users[...]\Documents\NVIDIA Nsight\Captures\build11__2015_06_20__15_15_15\Resources.h 27 8 build11__2015_06_20__15_15_15

It is a bug in the way Nsight serializes the frame. The solution is to add
#include <dxgi1_2.h>
to resources.h
and, in my case, change the second parameter to CreateSwapChainForHwnd from NULL to hWindow_000D060E in the Resources00.cpp file.

Related

Declare function that returns a string in header file

How do you declare a function that returns a string in the header file, so it can be used by other *.cpp files.
For example the code bellow does not compile with the following errors:
Source.h
#pragma once
#include <string>
string MyFunc();
Source.cpp
#include "stdafx.h"
#include "Source.h"
using namespace std;
string MyFunc()
{
string str;
return str;
}
Errors
Error 1 error C2146: syntax error : missing ';' before identifier 'MyFunc' 4 1
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 4 1
Error 3 error C2872: 'string' : ambiguous symbol 5 1
Error 4 error C2146: syntax error : missing ';' before identifier 'MyFunc' 5 1
Error 5 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 5 1
Error 6 error C2086: 'int string' : redefinition 5 1
Error 7 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 6 1
Error 8 error C2872: 'string' : ambiguous symbol 7 1
Error 9 error C2146: syntax error : missing ';' before identifier 'str' 7 1
Error 10 error C2065: 'str' : undeclared identifier 7 1
Error 11 error C2065: 'str' : undeclared identifier 8 1
If I replace string with char*, it compiles with no errors.
What about:
std::string MyFunc();
You'll need to add the std:: prefix unless you use the namespace. Generally you might as well prefix it to avoid conflict with your own classes.

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;

VS2010 IntelliSense says: CComPtr is not a template

I have encountered a problem when I was trying to write a directshow-based livestream player as an ActiveX control.
I first created a MFC ActiveX control project with VS2010 (under VC++ category),
and attached a dialog on the control, then tested it with a simple html page.
So far it works well, but when I tried to add some directshow codes with CComPtr,
the compiler shows the following errors (I've also attached the line numbers and files):
29 IntelliSense: CComPtr is not a template (CIceBaseLivestreamPlayerCore.h, Line 37)
30 IntelliSense: CComPtr is not a template (CIceBaseLivestreamPlayerCore.h, Line 38)
31 IntelliSense: CComPtr is not a template (CIceBaseLivestreamPlayerCore.h, Line 44)
32 IntelliSense: CComPtr is not a template (CIceBaseLivestreamPlayerCore.h, Line 44)
33 IntelliSense: CComPtr is not a template (CIceBaseLivestreamPlayerCore.h, Line 47)
34 IntelliSense: CComPtr is not a template (CIceBaseLivestreamPlayerCore.h, Line 48)
35 IntelliSense: CComPtr is not a template (CIceBaseLivestreamPlayerCore.h, Line 49)
36 IntelliSense: CComPtr is not a template (CIcePlayAndSaveAXCore.h, Line 19)
37 IntelliSense: CComPtr is not a template (CIcePlayAndSaveAXCore.h, Line 20)
38 IntelliSense: CComPtr is not a template (CIcePlayAndSaveAXCore.h, Line 21)
39 IntelliSense: CComPtr is not a template (CIcePlayAndSaveAXCore.h, Line 22)
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (CIceBaseLivestreamPlayerCore.h, Line 37)
Error 5 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (CIceBaseLivestreamPlayerCore.h, Line 38)
Error 14 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (CIcePlayAndSaveAXCore.h, Line 19)
Error 17 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (CIcePlayAndSaveAXCore.h, Line 20)
Error 20 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (CIcePlayAndSaveAXCore.h, Line 21)
Error 23 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (CIcePlayAndSaveAXCore.h, Line 22)
Error 25 error C2614: 'CIcePlayAndSaveAXCore' : illegal member initialization: 'm_vInfTee' is not a base or member (CIcePlayAndSaveAXCore.h, Line 9)
Error 27 error C2614: 'CIcePlayAndSaveAXCore' : illegal member initialization: 'm_fileWriter' is not a base or member (CIcePlayAndSaveAXCore.h, Line 9)
Error 28 error C2614: 'CIcePlayAndSaveAXCore' : illegal member initialization: 'm_AVIMux' is not a base or member (CIcePlayAndSaveAXCore.h, Line 9)
Error 26 error C2614: 'CIcePlayAndSaveAXCore' : illegal member initialization: 'm_aInfTee' is not a base or member (CIcePlayAndSaveAXCore.h, Line 9)
Error 12 error C2614: 'CIceBaseLivestreamPlayerCore' : illegal member initialization: 'm_pGraph' is not a base or member (CIceBaseLivestreamPlayerCore.h, Line 18)
Error 11 error C2614: 'CIceBaseLivestreamPlayerCore' : illegal member initialization: 'm_pControl' is not a base or member (CIceBaseLivestreamPlayerCore.h, Line 18)
Error 3 error C2238: unexpected token(s) preceding ';' (CIceBaseLivestreamPlayerCore.h, Line 37)
Error 6 error C2238: unexpected token(s) preceding ';' (CIceBaseLivestreamPlayerCore.h, Line 38)
Error 15 error C2238: unexpected token(s) preceding ';' (CIcePlayAndSaveAXCore.h, Line 19)
Error 18 error C2238: unexpected token(s) preceding ';' (CIcePlayAndSaveAXCore.h, Line 20)
Error 21 error C2238: unexpected token(s) preceding ';' (CIcePlayAndSaveAXCore.h, Line 21)
Error 24 error C2238: unexpected token(s) preceding ';' (CIcePlayAndSaveAXCore.h, Line 22)
Error 1 error C2143: syntax error : missing ';' before '<' (CIceBaseLivestreamPlayerCore.h, Line 37)
Error 4 error C2143: syntax error : missing ';' before '<' (CIceBaseLivestreamPlayerCore.h, Line 38)
Error 13 error C2143: syntax error : missing ';' before '<' (CIcePlayAndSaveAXCore.h, Line 19)
Error 16 error C2143: syntax error : missing ';' before '<' (CIcePlayAndSaveAXCore.h, Line 20)
Error 19 error C2143: syntax error : missing ';' before '<' (CIcePlayAndSaveAXCore.h, Line 21)
Error 22 error C2143: syntax error : missing ';' before '<' (CIcePlayAndSaveAXCore.h, Line 22)
Error 7 error C2061: syntax error : identifier 'CComPtr' (CIceBaseLivestreamPlayerCore.h, Line 44)
Error 8 error C2061: syntax error : identifier 'CComPtr' (CIceBaseLivestreamPlayerCore.h, Line 47)
Error 9 error C2061: syntax error : identifier 'CComPtr' (CIceBaseLivestreamPlayerCore.h, Line 48)
Error 10 error C2061: syntax error : identifier 'CComPtr' (CIceBaseLivestreamPlayerCore.h, Line 49)
And all these errors seem to specify that there is something weird with the CComPtr,
but I cannot figure out what's wrong.
I've added two header files in the bottom of my stdafx.h as following:
#include <streams.h>
#include <atlbase.h>
And I'll list part of my CIceBaseLivestreamPlayerCore.h and CIcePlayAndSaveAXCore.h as below, all the involved lines in the above errors are all included.
CIceBaseLivestreamPlayerCore.h:
#pragma once
#include "stdafx.h"
class CIceBaseLivestreamPlayerCore
{
...
15 CIceBaseLivestreamPlayerCore():
16 ..., m_pGraph(NULL), m_pControl(NULL),
17 ...
18 { ; }
...
37 CComPtr<IGraphBuilder> m_pGraph;
38 CComPtr<IMediaControl> m_pControl;
...
44 HRESULT ConnectFilters(CComPtr<IBaseFilter> pIn, CComPtr<IBaseFilter> pOut, const AM_MEDIA_TYPE& mType);
...
47 HRESULT MatchPin(CComPtr<IPin>, PIN_DIRECTION, BOOL, BOOL*);
48 HRESULT IsPinConnected(CComPtr<IPin>, BOOL*);
49 HRESULT IsPinDirection(CComPtr<IPin>, PIN_DIRECTION, BOOL*);
};
CIcePlayAndSaveAXCore.h:
#pragma once
#include "CIceBaseLivestreamPlayerCore.h"
class CIcePlayAndSaveAXCore : public CIceBaseLivestreamPlayerCore
{
...
7 CIcePlayAndSaveAXCore() :
8 m_AVIMux(NULL), m_fileWriter(NULL), m_aInfTee(NULL), m_vInfTee(NULL)
9 { ; }
...
19 CComPtr<IBaseFilter> m_AVIMux;
20 CComPtr<IBaseFilter> m_fileWriter;
21 CComPtr<IBaseFilter> m_aInfTee;
22 CComPtr<IBaseFilter> m_vInfTee;
};
Additional dependencies of my project is "strmbasd.lib;winmm.lib;uuid.lib;".
That's all.. Hope someone can give me the answer of how to solve it,
or just gives me any advice or suggestion as a direction of what I should do.
Any help is appreciated.
And this is my first time to post an English question (I'm not a native speaker though..),
so please let me know if I've anything lost or done something wrong as asking a question.
Thanks a lot. :)
After many times of trying I finally found the problem and got it solved.
I think I should put the result here, for there might be someone who has the same problem,
and is not knowing how to solve it like I was. I don't know if it's an etiquette offense of stackoverflow to answer my own question, so I will left this answer unaccepted.
As I've said, I've put #define <atlbase.h> into the bottom of my stdafx.h.
But because I'm making a MFC ActiveX control project, the IDE (VS 2010) auto generates a #define statement into my stdafx.h, which is #define _ATL_NO_AUTOMATIC_NAMESPACE.
And when we use #include <atlbase.h> in ordinary times, the compiler will perform using namespace ATL by default, but this #define _ATL_NO_AUTOMATIC_NAMESPACE statement cancels this behavior, which then caused the naming conflict that my compiler had said.
So, in this case, just use ATL::CComPtr for declarations or directly use using ATL::CComPtr statement in which CComPtr appears, and this compilation error will be eliminated.

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.