Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Bar: 'class' type redefinition compile time error

Reply
Thread Tools

Bar: 'class' type redefinition compile time error

 
 
A
Guest
Posts: n/a
 
      10-22-2003
Hi,

I created an array of user defined objects dynamically in a class Foo's
constructor.

class Foo{

Foo(){
Bar* b = new Bar();
}

It gave me a "no default constructor for object Bar" so i added it like so:

class Bar{

Bar(){}; //added this one
Bar(double d1, double d2){...};
}

now i get a
Bar: 'class' type redefinition compile time error.



Any helps appreciated.

REgards

dsf





 
Reply With Quote
 
 
 
 
Josephine Schafer
Guest
Posts: n/a
 
      10-22-2003

"A" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> Hi,
>
> I created an array of user defined objects dynamically in a class Foo's
> constructor.
>
> class Foo{
>
> Foo(){
> Bar* b = new Bar();
> }
>
> It gave me a "no default constructor for object Bar" so i added it like so:
>
> class Bar{
>
> Bar(){}; //added this one


No semicolon here.

> Bar(double d1, double d2){...};


Same here
> }

;
Semicolon here.

>
> now i get a
> Bar: 'class' type redefinition compile time error.
>
>
>

HTH,
J.Schafer


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
computation at compile time i.e. compile time functions usingtemplates Carter C++ 2 03-04-2009 06:43 PM
cant compile on linux system.cant compile on cant compile onlinux system. Nagaraj C++ 1 03-01-2007 11:18 AM
Redefinition Error cody C++ 3 09-18-2005 02:32 PM
'class' type redefinition squallions@yahoo.com C++ 1 11-07-2004 05:51 AM
'class' type redefinition Son C++ 0 11-07-2004 05:02 AM



Advertisments