Results 1 to 5 of 5

Thread: Its saying Class isn't defined any ideas why?

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member voidflux's Avatar
    Join Date
    Jun 2003
    Location
    Brockway, PA
    Posts
    290

    Re: Its saying Class isn't defined any ideas why?

    Thanks CornedBee my design was really screwed up!
    Do I have any recrusive inclusion now?

    For some reason i'm still getting an odd error though that says:
    Code:
    \EmailDomain.h(27) : error C2146: syntax error : missing ';' before identifier 'Tld'
    1>EmailDomain.h(27) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int



    I fixed that problem by commenting out the EmailTld.cpp file, but now I'm back to my orginal error yay! but this one i think can be fixed easily but i'm not sure where

    [code]
    Hm....I seemed to resolved the problem by commenting out the EmailTld.cpp file, but now i'm getting the following:
    Code:
    EmailTld.h(13) : error C2504: 'EmailSubdomain' : base class undefined
    1>EmailDomain.cpp

    Code:
    //file:		Email.h
    //Code by:	Cory Sanchez
    
    
    #pragma once
    #include "EmailDomain.h"
    #include "EmailLocalPart.h"
    
    #include <string>
    
    
    
    class Email
    {
    public:
    
    
    	Email(std::string address)
    	{
    		// Here we initialize Email’s internal
    		// Address property of type String
    		Address = address;
    	}
    
    
    	std::string Address;
    	EmailLocalPart LocalPart;
    	EmailDomain Domain;      
    
    
    	void Parse();
    	bool IsValid();
    };
    Code:
    //file:		EmailDomain.h
    //Code by:	Cory Sanchez
    
    #pragma once
    
    //class EmailSubdomain;
    
    #include "EmailTld.h"
    
    
    
    
    #define MAX_SUBDOMAINS 10
    #include <string>
    
    class EmailDomain
    {
       public:
          EmailDomain()
          {
              SubdomainCount = 0;
    		  Name = "";
          }
       
       public:
    	  std::string Name;
    	  EmailTld Tld;
          int SubdomainCount;
    
    
       public:
          bool Parse();
          bool IsValid();    
    	  int GetLengthSubdomain(const char *text, int startPos, char aChar);
    };
    Code:
    //file:		EmailLocalPart.h
    //Code by:	Cory Sanchez
    
    #pragma once
    #include <iostream>
    #include <string>
    
    class EmailLocalPart
    {
       public:
          EmailLocalPart()
    	  {
    		  UserName = "";
    	  }
       
       public:
    	   std::string UserName;
    
       public:
          bool IsValid();
    
    };
    Code:
    //file:		EmailSubdomain.h
    //Code by:	Cory Sanchez
    
    #pragma once
    
    
    
    #include "EmailDomain.h"
    #include <string>
    
    //class EmailDomain;
    
    
    class EmailSubdomain
    {
       public:
          EmailSubdomain()
    	  {
    		  Name = "";
    	  }
       
       public:
    	 
    	   std::string Name;
    
       public:
           bool IsValid(); 
     
    };
    Code:
    //file:		EmailTld.h
    //Code by:	Cory Sanchez
    
    
    #pragma once
    
    #include "EmailSubdomain.h"
    // Subdomain and Tld are identical, except for
    // slight differences in validation rules, so to avoid repetition derive EmailTld class from EmailSubdomain base class
    
    class EmailTld: public EmailSubdomain // EmailTld class is derived from
    	
    {
    public:
    	EmailTld();
    
    
    public:
    	virtual bool IsValid(); 
    };
    Last edited by voidflux; Feb 16th, 2007 at 05:36 PM.
    C¤ry Sanchez
    Computer Science/Engineering
    @ Penn State
    IBM.zSeries Intern
    Mandriva 2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width