• 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
Namespace bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Namespace bug?


  • Subject: Namespace bug?
  • From: Scott Andrew <email@hidden>
  • Date: Fri, 18 Nov 2005 21:37:06 -0800

I am working on porting some code over from MSVC so that the project will compile on both the mac and windows. The code defines a class like so..

namespace DOM
{
    class Comments
    {
        public:
            Comments();
            ...
            ...
    };
}

the cpp file looks like so

#include "Comments.h"

using namespace DOM;

Comments::Comments()
{
}

...
...


the error i get is the Comments can't be used without a type. Then I get told that it conflicts with a struct in AIFF.H (we include Carbon.h into all of our files by default. (i am working on a carbon project/Cocoa mixed project).


However if  change my .cpp file to be....

DOM::Comments::Comments()
{
}

.. and add DOM:: to function declarations all is fine. Shouldn't the compiler recognize i am in a new namespace or do i have to qualify the declarations because of a global Comments?

ScottAndrew


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Namespace bug?
      • From: David Fang <email@hidden>
  • Prev by Date: Re: convert a perl script to C/C++
  • Next by Date: Re: [2.2] Cant get __attribute__ ((__packed__)) to work
  • Previous by thread: Re: Target properties "Executable" field
  • Next by thread: Re: Namespace bug?
  • Index(es):
    • Date
    • Thread