• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Objective C++: 'not a member'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective C++: 'not a member'


  • Subject: Re: Objective C++: 'not a member'
  • From: Will Mason <email@hidden>
  • Date: Fri, 21 Oct 2005 14:53:33 -0700 (PDT)

>From the source code snippets you provided it looks like the function ParseXml() is inside the LibXml namespace which is inside the XmlDom namespace. With that configuration, even though you specify using namespace XmlDom, referring to XmlDom::ParseXml() should not and apparently does not resolve the name. ParseXml() is not in the XmlDom namespace. Since you're already "using" namespace XmlDom, maybe you should refer to the function as LibXml::ParseXml(), with the namespace XmlDom already implied.

 Just a thought,
 Will

----- Original Message ----
From: Michael Hanna <email@hidden>
To: Cocoa List <email@hidden>
Sent: Fri Oct 21 14:52:41 2005
Subject: Objective C++: 'not a member'

In LDataTypeManager.mm I get the error:

/Users/mhanna/myDev/DataTypeRoot01/LDataTypeManager.mm:130: error:
'ParseXml' is not a member of 'XmlDom'

from

     myString = [NSString stringWithContentsOfFile:fullPathToDTXML];
     strLength = [myString length];
     unsigned char const* cs = (unsigned char*) [myString UTF8String];
     currDoc = XmlDom::ParseXml( cs, strLength);            //
offending line of code

at the top of LDataTypeManager.mm I have:



        #import <XmlDom/XmlDom.h>
        using namespace XmlDom;


in XmlDom.h I have:


#ifndef __LIBS_XMLDOM_XMLDOM_H__
#define __LIBS_XMLDOM_XMLDOM_H__

#pragma once
#ifdef XMLDOM_USE_LIBXML

[...]

#include "LibXml/XmlParser.h"

#else

[...]

#endif

namespace XmlDom
{

// bring the definitions we want to use into this namespace

#ifdef XMLDOM_USE_LIBXML

using namespace LibXml;

#else

[...]

#endif

}
#endif


inside XmlParser.h :

namespace XmlDom {

namespace LibXml {
XmlDocument ParseXml(const void * pData, size_t nLength, EncodingType
et);
template<class T>
XmlDocument ParseXml(const T * pData, size_t nLength)
{
     return ParseXml(static_cast<const void *>(pData), nLength *
sizeof(T), sizeof(T) == 4 ? etUTF32 : sizeof(T) == 2 ? etUTF16 :
etUTF8);
}

[...]

inside XmlParser.cpp:

namespace XmlDom {

namespace LibXml {

XmlDocument ParseXml(const void * pData, size_t nLength, EncodingType
et)
{

[...]

in XCode under project info  > Other C++ Flags I also have added -
DXMLDOM_USE_LIBXML

any ideas why it can't find XmlDom::ParseXML() ? I think the
namespacing is correct

Michael

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Objective C++: 'not a member' (From: Michael Hanna <email@hidden>)

  • Prev by Date: [solved[ Re: Cocoa framework bug? - Checkboxes turning black on 10.4
  • Next by Date: Re: Binding to CoreImage?
  • Previous by thread: Objective C++: 'not a member'
  • Next by thread: Making transparent parts of an opengl view drop clicks to the application behind it
  • Index(es):
    • Date
    • Thread