[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster] Errors in C++ Client when using in C++ project



Tiago Cardoso wrote:
Hi,

I’m using xmlBlaster (version 1.0.1 Xmas 2005-02-08) and recently I
created from HelloWord 2 example a C++ Client. Essentially, I copy-paste
the login/subscribe/publish/erase/logout into methods and created
another class for callback.
These classes alone compile and work perfectly, sending and receiving
messages from the server, but now I tried to add these classes to
another project (that is going to use XmlBlaster) in order to add a
XmlBlaster (C++) Client to the application and add some problems:
If I just add the classes, the project still compiles perfectly, but
when I use the classes anywhere of the application (this is, when I
create a XmlBlaster Client entity), I get a lot of errors, most of then
syntax errors of xmlBlaster C++ include files.

From looking at your slashes i assume a Windows environment and Visual C++. We don't use any 'using' name spaces in the headers as this would make the name spaces useless. I believe one of your headers has a define which causes the conflict.

You can play with the sequence of including your headers
and xmlBlaster headers to find out what causes the conflict
and report it to us so we try to avoid such situations
in a next release.

My approach would be:

Write a little delegate class which contains all xmlBlaster specific
header and code but no specific headers of your project (see XmlBlasterPlugin).
Outside of this delegate class don't use any xmlBlaster dependency.

The delegate inherits from a abstract base class (see MomInterface)
with pure virtual functions (an interface),
and your code only talks via this base class.

Like this you have a clear separation of duties and a clean design:


+++++++++++ +++++++++++++++ +Your code+ ---> + MomInterface+ (no xmlBlaster includes) +++++++++++ +++++++++++++++ | v | ++++++++++++++++++++ + XmlBlasterPlugin + ---> xmlBlaster client library ++++++++++++++++++++

best regards

Marcel



Here are some examples:

"
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\PriorityEnum.h(21) :
error C2143: syntax error : missing '}' before 'constant'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\PriorityEnum.h(67) :
error C2143: syntax error : missing ';' before '}'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\PriorityEnum.h(75) :
error C2059: syntax error : '}'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\PriorityEnum.h(75) :
error C2143: syntax error : missing ';' before '}'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\PriorityEnum.h(75) :
error C2059: syntax error : '}'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\cluster\NodeId.h(24) :
error C2143: syntax error : missing ';' before '{'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\cluster\NodeId.h(24) :
error C2447: '{' : missing function header (old-style formal list?)
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\cluster\RouteInfo.h(23)
: error C2039: 'NodeId' : is not a member of
'org::xmlBlaster::util::cluster'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\cluster\RouteInfo.h(23)
: error C2146: syntax error : missing ';' before identifier 'nodeId_'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\cluster\RouteInfo.h(23)
: error C2501: 'org::xmlBlaster::util::cluster::RouteInfo::NodeId' :
missing storage-class or type specifiers
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\cluster\RouteInfo.h(23)
: error C2501: 'org::xmlBlaster::util::cluster::RouteInfo::nodeId_' :
missing storage-class or type specifiers
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\cluster\RouteInfo.h(38)
: error C2039: 'NodeId' : is not a member of
'org::xmlBlaster::util::cluster'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\cluster\RouteInfo.h(38)
: error C2226: syntax error : unexpected type
'org::xmlBlaster::util::Timestamp'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\cluster\RouteInfo.h(38)
: error C2238: unexpected token(s) preceding ';'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\cluster\RouteInfo.h(43)
: error C2039: 'NodeId' : is not a member of
'org::xmlBlaster::util::cluster'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\cluster\RouteInfo.h(43)
: error C2143: syntax error : missing ',' before '&'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\cluster\RouteInfo.h(48)
: error C2039: 'NodeId' : is not a member of
'org::xmlBlaster::util::cluster'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\cluster\RouteInfo.h(48)
: error C2146: syntax error : missing ';' before identifier 'getNodeId'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\cluster\RouteInfo.h(48)
: error C2501: 'org::xmlBlaster::util::cluster::RouteInfo::NodeId' :
missing storage-class or type specifiers
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\cluster\RouteInfo.h(48)
: warning C4183: 'getNodeId': missing return type; assumed to be a
member function returning 'int'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\qos\QosData.h(168) :
error C2039: 'NodeId' : is not a member of 'org::xmlBlaster::util::cluster'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\qos\QosData.h(168) :
error C2143: syntax error : missing ',' before '&'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\qos\QosData.h(174) :
error C2039: 'NodeId' : is not a member of 'org::xmlBlaster::util::cluster'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\qos\QosData.h(174) :
error C2061: syntax error : identifier 'NodeId'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\qos\MsgQosData.h(107) :
error C2039: 'PriorityEnum' : is not a member of 'org::xmlBlaster::util'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\qos\MsgQosData.h(262) :
error C2039: 'PriorityEnum' : is not a member of 'org::xmlBlaster::util'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\util\qos\MsgQosData.h(270) :
error C2039: 'PriorityEnum' : is not a member of 'org::xmlBlaster::util'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\client\qos\PublishQos.h(89) :
error C2039: 'PriorityEnum' : is not a member of 'org::xmlBlaster::util'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\client\qos\PublishQos.h(97) :
error C2039: 'PriorityEnum' : is not a member of 'org::xmlBlaster::util'
c:\Tiago\Projectos\Libs\xmlBlaster\src\c++\client\qos\GetReturnQos.h(84)
: error C2039: 'PriorityEnum' : is not a member of 'org::xmlBlaster::util'
"
(ok, these were all the errors, sorry… )
(all files are known so I wont attach them to the mail.)

Does anybody has any clue about these errors ?
I was suspicious that this was caused by Namespaces.. so I took all
using namespace from header files (but still using on cpp files) but I
still got the same errors.

Can anyone help me? plz.
Thanks in advance.

Best Regards,

Tiago Cardoso





--
http://www.xmlBlaster.org