undefined class errors (C2079)

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2005
Posts: 1
Reputation: tantomushi is an unknown quantity at this point 
Solved Threads: 0
tantomushi tantomushi is offline Offline
Newbie Poster

undefined class errors (C2079)

 
0
  #1
Mar 5th, 2005
Hi!

I'm really new to all this so please excuse me if I'm not providing enough information for anyone to answer my question. I'm getting this error:

  1. error C2079: 'Playlist::PLarray::playlists' uses undefined class Playlist


and it's referencing a line in my PLarray.hpp file-> see ***

PLarray.hpp:

  1. #include <iostream>
  2. #include <cassert>
  3. #include "style.hpp"
  4. #include "Playlist.hpp"
  5.  
  6.  
  7. class PLarray
  8. {
  9. public:
  10. PLarray()
  11. //creates this PLarraywith the default values
  12. {}
  13.  
  14. ~PLarray()
  15. //destroys this PLarray object
  16. {std::cout << "In ~PLArray()";}
  17.  
  18. const Playlist operator [] (unsigned IN location) const;
  19. //returns a specified playlist
  20.  
  21. Playlist& operator [] (unsigned IN location);
  22. //returns access to a specified playlist
  23.  
  24. enum {capacity = 10};
  25.  
  26. ///***
  27. private:
  28. Playlist playlists[capacity];
  29.  
  30. };
  31. #endif

And here is my implementation file that I think it's also referring to:


PLArray.cpp

  1. #include "PLArray.hpp"
  2. #include <cassert>
  3.  
  4.  
  5. using namespace std;
  6.  
  7.  
  8.  
  9.  
  10. const Playlist PLarray:: operator [] (unsigned location) const
  11. { assert (location < capacity);
  12. return playlists [location];
  13. }
  14.  
  15. Playlist& PLarray:: operator [] (unsigned location)
  16. { assert (location < capacity);
  17. return playlists [location];
  18.  
  19. }

I'm stumped. Any ideas?
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 780
Reputation: OurNation is an unknown quantity at this point 
Solved Threads: 9
OurNation's Avatar
OurNation OurNation is offline Offline
Master Poster

Re: undefined class errors (C2079)

 
0
  #2
Mar 5th, 2005
Heres what I found on the error it occurs "If an instantiation of a class template is required, and the template declared but not defined, the program is ill-formed."
PETA People for the Eating of Tasty Animals.


FireFox
Hijack This
Ad-Aware
Hijack this tutorial
Microsoft AntiSpyware
CompUchat
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 780
Reputation: OurNation is an unknown quantity at this point 
Solved Threads: 9
OurNation's Avatar
OurNation OurNation is offline Offline
Master Poster

Re: undefined class errors (C2079)

 
0
  #3
Mar 5th, 2005
Try adding #include <fstream>
PETA People for the Eating of Tasty Animals.


FireFox
Hijack This
Ad-Aware
Hijack this tutorial
Microsoft AntiSpyware
CompUchat
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC