Re: Error using 'using'

Discussion in 'C++' started by Russell Hanneken, Aug 15, 2003.

  1. Laianna Nuveryn wrote:
    >
    > The code fragment looks like this :
    >
    > #include <xercesc/sax/HandlerBase.hpp>
    > #include <iostream>
    >
    > #include "ThreatListModel.h"
    >
    > XERCES_CPP_NAMESPACE_USE
    >
    > XERCES_CPP_NAMESPACE_BEGIN
    > class AttributeList;
    > XERCES_CPP_NAMESPACE_END
    >
    > When I try to compile this file, I get an error message saying
    > error C2143: syntax error : missing ';' before 'using'
    >
    > I'm not sure what the issue is. Help?


    Well, consulting the Xerces documentation at

    http://xml.apache.org/xerces-c/apiDocs/XercesDefs_8hpp-source.html

    I /think/ your code must look something like this after the macros are
    expanded by the preprocessor:

    #include <xercesc/sax/HandlerBase.hpp>
    #include <iostream>

    #include "ThreatListModel.h"

    using namespace XERCES_CPP_NAMESPACE;

    namespace XERCES_CPP_NAMESPACE {
    class AttributeList;
    }

    (I'm guessing the XercesDefs.hpp header file is included via
    HandlerBase.hpp.)

    Anyway, I don't see anything obviously wrong with the using directive.
    My best guess is that you left off a semicolon in a declaration within
    ThreatListModel.h.

    --
    Russell Hanneken
     
    Russell Hanneken, Aug 15, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hfk0
    Replies:
    2
    Views:
    21,751
  2. JavaQueries
    Replies:
    1
    Views:
    3,770
    John C. Bollinger
    Mar 1, 2005
  3. Balaji
    Replies:
    3
    Views:
    10,201
  4. Bishop
    Replies:
    1
    Views:
    832
    Bishop
    Feb 24, 2007
  5. juvi
    Replies:
    3
    Views:
    1,083
    Alexey Smirnov
    Jan 22, 2009
Loading...

Share This Page