| | |
undefined class errors (C2079)
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2005
Posts: 1
Reputation:
Solved Threads: 0
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:
and it's referencing a line in my PLarray.hpp file-> see ***
PLarray.hpp:
And here is my implementation file that I think it's also referring to:
PLArray.cpp
I'm stumped. Any ideas?
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:
C++ Syntax (Toggle Plain Text)
error C2079: 'Playlist::PLarray::playlists' uses undefined class Playlist
and it's referencing a line in my PLarray.hpp file-> see ***
PLarray.hpp:
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <cassert> #include "style.hpp" #include "Playlist.hpp" class PLarray { public: PLarray() //creates this PLarraywith the default values {} ~PLarray() //destroys this PLarray object {std::cout << "In ~PLArray()";} const Playlist operator [] (unsigned IN location) const; //returns a specified playlist Playlist& operator [] (unsigned IN location); //returns access to a specified playlist enum {capacity = 10}; ///*** private: Playlist playlists[capacity]; }; #endif
And here is my implementation file that I think it's also referring to:
PLArray.cpp
C++ Syntax (Toggle Plain Text)
#include "PLArray.hpp" #include <cassert> using namespace std; const Playlist PLarray:: operator [] (unsigned location) const { assert (location < capacity); return playlists [location]; } Playlist& PLarray:: operator [] (unsigned location) { assert (location < capacity); return playlists [location]; }
I'm stumped. Any ideas?
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
FireFox
Hijack This
Ad-Aware
Hijack this tutorial
Microsoft AntiSpyware
CompUchat
Try adding #include <fstream>
PETA People for the Eating of Tasty Animals.
FireFox
Hijack This
Ad-Aware
Hijack this tutorial
Microsoft AntiSpyware
CompUchat
FireFox
Hijack This
Ad-Aware
Hijack this tutorial
Microsoft AntiSpyware
CompUchat
![]() |
Similar Threads
- Help with header file (C++)
- is not a class or namespace name error (C++)
- Undefined reference errorsto function declared in header file but defined in Cpp file (C++)
- Class Errors (C++)
- please help with these error problems (C++)
- undefined reference errors when using C++ Sockets Library (C++)
Other Threads in the C++ Forum
- Previous Thread: Any Boolean Expression to Sum of Minterms
- Next Thread: Auxiliary Operator definition
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





