我几个小时都得到了相同的错误,因此无法检查算法问题,我每次都会得到相同的错误。 代码块错误:
C:\cygwin\home\Ryan\P1311\Playlist.h:19:4: error: 'DoublyLinkedList' does not name a type
C:\cygwin\home\Ryan\P1311\Playlist.h:22:27: error: 'string' has not been declared
C:\cygwin\home\Ryan\P1311\Playlist.h:23:29: error: 'string' has not been declared
C:\cygwin\home\Ryan\P1311\Playlist.h:24:28: error: 'string' has not been declared
C:\cygwin\home\Ryan\P1311\Playlist.h:25:27: error: 'string' has not been declared
C:\cygwin\home\Ryan\P1311\Playlist.h:27:25: error: 'string' has not been declared
进程终止,状态为1(0分0秒)
注意:我不允许更改playlist.h和playlist.cpp文件中的任何内容,我们会将它们分配给我。
#ifndef CSCI_311_PLAYLIST_H
#define CSCI_311_PLAYLIST_H
class Playlist {
public:
void mainLoop(); // process commands until done
private:
DoublyLinkedList dll; // playlist stored in doubly linked list
void processCommand(); // read and process one playlist command
void processAppendSong(string&); // appends song to playlist
void processInsertBefore(string&); // insert song before current position
void processInsertAfter(string&); // insert song after current position
void processRemoveSong(string&); // removes the specified song
void processPlayCurrent(); // "plays" song at the current position
void processGotoSong(string&); // sets the current position to song
void processGotoFirstSong(); // goes to the first song
void processGotoLastSong(); // goes to the last song
void processNextSong(); // go to next song
void processPrevSong(); // go to previous song
void processPlayForward(); // "play" all songs from current to end
void processPlayReverse(); // "play" all songs from current to start
};
#endif // CSCI_311_PLAYLIST_H