Question: fix this error on thise code Failed to compile / usr / bin / ld: / tmp / ccjiVUh 1 . o: in function `
fix this error on thise code Failed to compile
usrbinld: tmpccjiVUho: in function main:
main.cpp:textxe: undefined reference to PrintMenustd::cxx::basicstring, std::allocator const&
usrbinld: main.cpp:textxa: undefined reference to ExecuteMenuchar std::cxx::basicstring, std::allocator const& PlaylistNode
collect: error: ld returned exit status
Step : File Structure and Class Definition
PlaylistNode.h Class declaration
#ifndef PLAYLISTNODEH
#define PLAYLISTNODEH
#include
class PlaylistNode
private:
std::string uniqueID;
std::string songName;
std::string artistName;
int songLength;
PlaylistNode nextNodePtr;
public:
PlaylistNode;
PlaylistNodeconst std::string& uniqueID, const std::string& songName,
const std::string& artistName, int songLength;
std::string GetID const;
std::string GetSongName const;
std::string GetArtistName const;
int GetSongLength const;
PlaylistNode GetNext const;
void InsertAfterPlaylistNode nodePtr;
void SetNextPlaylistNode nodePtr;
void PrintPlaylistNode const;
;
#endif
Step
PlaylistNode.cpp Class definition
#include "PlaylistNode.h
#include
PlaylistNode::PlaylistNode
: uniqueIDnone songNamenone artistNamenone songLength nextNodePtrnullptr
PlaylistNode::PlaylistNodeconst std::string& uniqueID, const std::string& songName,
const std::string& artistName, int songLength
: uniqueIDuniqueID songNamesongName artistNameartistName songLengthsongLength nextNodePtrnullptr
std::string PlaylistNode::GetID const return uniqueID;
std::string PlaylistNode::GetSongName const return songName;
std::string PlaylistNode::GetArtistName const return artistName;
int PlaylistNode::GetSongLength const return songLength;
PlaylistNode PlaylistNode::GetNext const return nextNodePtr;
void PlaylistNode::InsertAfterPlaylistNode nodePtr
PlaylistNode temp thisnextNodePtr;
thisnextNodePtr nodePtr;
if nodePtr nullptr
nodePtrnextNodePtr temp;
void PlaylistNode::SetNextPlaylistNode nodePtr
thisnextNodePtr nodePtr;
void PlaylistNode::PrintPlaylistNode const
std::cout "Unique ID: uniqueID std::endl;
std::cout "Song Name: songName std::endl;
std::cout "Artist Name: artistName std::endl;
std::cout "Song Length in seconds: songLength std::endl;
main.cpp
#include
#include
#include "PlaylistNode.h
void PrintMenuconst std::string& playlistTitle;
PlaylistNode ExecuteMenuchar option, const std::string& playlistTitle, PlaylistNode headNode;
int main
std::string playlistTitle;
std::cout "Enter playlist's title: ;
std::getlinestd::cin, playlistTitle;
char choice;
PlaylistNode headNode nullptr;
do
PrintMenuplaylistTitle;
std::cin choice;
headNode ExecuteMenuchoice playlistTitle, headNode;
while choice q;
Cleanup code if necessary
return ;
void PrintMenuconst std::string playlistTitle
std::cout playlistTitle PLAYLIST MENU" std::endl;
std::cout a Add song" std::endl;
std::cout d Remove song" std::endl;
std::cout c Change position of song" std::endl;
std::cout s Output songs by specific artist" std::endl;
std::cout t Output total time of playlist in seconds std::endl;
std::cout o Output full playlist" std::endl;
std::cout q Quit" std::endl;
std::cout "Choose an option:" std::endl;
Type your ExecuteMenu implementation here, following similar logic
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
