Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8805323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:50:17+00:00 2026-06-14T01:50:17+00:00

I am currently suffering with problems with adding Pairs to my List program and

  • 0

I am currently suffering with problems with adding Pairs to my List program and then spitting it out to have it work in my scramble program which is mean to find words sorta like boggle, but with no set size and I have to generate the words/letters.

This code is in my scramble.cc program.

List history;

bool placeAlreadyUsed(int x, int y, List history)
{
 for(size_t i=0; i < history.getSize(); i++)
  {
   Pair p1 = history.get(i)
   if(p1.r == x && p1.c == y)
    return true;
  }
 return false
}

bool findUsersWord(string findThis, string alreadyFound, List &history, int maxR, int maxC)
{  
  // need to find the findThis  base case
  if (findThis == alreadyFound)
    cout << "SOLVED" << endl;
    return true;

  // need to find the first letter within the board and then progress around that.
  if (alreadyFound.empty())
  {
    for (int rows = 0; rows < maxR; rows++)
      for (int cols = 0; cols < maxC; cols++)
        // find the each character within the 
        if (theBoard[rows][cols] == findThis[0])
        {
          alreadyFound = findThis[0];
          Pair newR;
          newR.r = rows;
          newR.c = cols;
          history.add(newR);
          if (findUsersWord(findThis, alreadyFound, history, maxR, maxC))
            return true;
          else
           {
            // clear out the found Board 
            size_t temp = history.getSize()
            for(size_t i=0; i<temp; i++
            {
             history.removeAt(i);
            }
          }
        }
  }
  else
  {
    // try and find the next letters within the area around the base letter
    // spin around the letter 3 * 3 grid
    for (int x= (p1.r > 0 ? p1.r-1: p1.r); y <=(p1.r == (maxR-1) ? p1.r : p1.r+1);x++)
      for (int y= (p1.c> 0 ? p1.c-1: p1.c); x<=(p1.c == (maxC-1) ? p1.c : p1.c+1);y++)
        if ((board[x][y] == findThis[alreadyFound.length()]) && (!(x==p1.r && y==p1.c)))
          // already used letter
          if (!placeAlreadyUsed(y,x,history))
          {
            alreadyFound += findThis[alreadyFound.length()];
            Pair newR;
            newR.r = x;
            newR.c = y;
            history.add(newR, alreadyFound.length());
            if (findUsersWord(findThis, alreadyFound, history, maxR, maxC))
              return true;
            else
            {
              if (alreadyFound.length() > 1)
                alreadyFound = alreadyFound.substr(0, alreadyFound.length()-1);
              history.removeAt(history.getSize()-1);
            }
          }
    return false;
  }
  return false;
}

My list.cc is the thing that is having a problem with this code:

#include <iostream>
#include <cassert>
#include <cstdlib>
#include "list.h"

using namespace std;

List::Node::Node()
{
 prev = next = NULL;
}

List:: List()
{
 front = new Node()
 rear = new Node()
 front->next = rear;
 rear->prev = front;

 currentIndex=0;
 current = front->next;
 size=0;
}

List::~List()
{
 _setCurrentIndex(0);
 while(current)
  {
   Node *temp = current;
   current = current -> next;
   delete temp;
  }
//not showing deep copy function b/c it isn't important for this program
void List::add(const ElementType & item, size_t index)
{
 assert(0<=index && index <= size);
 _setCurrentIndex(index);
 size++;

 Node *born = new Node;
 born->data = item;
 born->prev = current->prev;
 born->prev->next = current;
 born->prev = born;
 current = born;
}

void List::removeAt(size_t index)
{
 assert(0<=index<=getSize());
 _setCurrentIndex(index);

 Node *old = current;
 current->prev->next = current->next;
 current->next->prev = current->prev;
 delete old;
 size--;
}

void List::remove(const ElementType & item)
{
 for(size_t i=0; i<size; i++)
  {
  _setCurrentIndex(i);
   if(find(item)<getSize())
    {
     Node *tempOld = current;
     current->next->prev = current->prev;
     current->prev->next = current->next;
     current = current->next;

     delete tempOld;
     size--;
    }
  }
}

size_t List::find(const ElementType & item) const
{
 for(size_t i=0; i<size; i++)
  {
   _setCurrentIndex(i)
   if(get(i) == item)
    return i;
  }
 return getSize();
}

List::ElementType List::get(size_t index) const
{
 assert(0 <= index < size);
 _setCurrentIndex(index);
 assert(current->next != NULL);
 return current->data;
}

size_t List::getSize() const
{
 return size;
}

void List::output(std::ostream & ostr) const
{
 for(size_t i=0; i<size; i++) 
  {
  _setCurrentIndex(i);
  ostr << current->data << " ";
  }
 ostr << endl;
}

void List:: _setCurrentIndex(size_t index) const
{
 int x;
 if(currentIndex > index)
  x = currentIndex - index;
 else
  x = index-currentIndex;

 if(index < (sizez_t)x)
  {
  current = front->next;
  curentIndex=0;
  while(currentIndex != index)
   {
   current = current->next;
   currentIndex++;
   }
  }
 else if((size-index) < (size_t)x)
  {
   current = rear;
   currentIndex = size;
   while(currentIndex != index)
    {
     current = current->prev;
     currentIndex--;
    }
  }
 else
  {
   if(currentIndex > index)
    {
    while(currentIndex!=index)
     {
      current = current->prev;
      currentIndex--;
     }
    }
   else
    {
     while(currentIndex!=index)
      {
       current = current->next;
       currentIndex++;
      }
    }
  }
}

The errors I am getting is
scramble.cc(.text+0x480): undefined reference to List::List(List const&)’
collect2: ld returned 1 exit status
make: * [scramble Error 1

Any ideas what is exactly is going on and how to approach to fix this?

EDIT: I am not missing any include statements, just didn’t put them in

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:50:18+00:00Added an answer on June 14, 2026 at 1:50 am

    It looks like your list.h probably declares a copy constructor, List::List(List const&), and your scramble.cc attempts to use it. However, you don’t actually implement the copy constructor in your list.cc file, so when it comes to linking, the copy constructor isn’t found. You’ll need to implement this function somewhere in list.cc:

    List::List(List const& other)
    {
      // Implement this
    }
    

    Top tip: when you get an error that looks like this (file.cc(.text+0x12AB) and mentions ld), it means you have a linker error. This is almost always because you’re attempting to use something that you’ve declared in one translation unit but never defined/implemented anywhere else. The compiler stage works fine because often it only needs to find a declaration to constitute a well-formed program, but when it comes to linking your program together, the linker throws up because it can’t find the actual implementation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I've got a multithreaded python program, which is currently suffering from deadlock. I
Currently I have 2 ways of displaying images in a cell, which way will
My server is currently suffering from some problems due to visitors lag and i
Currently, I'm working on a project where I have a server - client relationship
Currently I have this code: <?php echo '<meta name=robots content=noindex>'; $arr = json_decode(file_get_contents(http://media1.clubpenguin.com/play/en/web_service/game_configs/ paper_items.json),true);
Currently i have a node.js and socket.io application in development on my local machine
Currently we have the requirement to implement the protocol buffering for server communication. Can
I have some .gz compressed files which is around 5-7gig uncompressed. These are flatfiles.
I am currently designing a correlation engine in java which is extracting data from
I'm currently suffering from some strange exceptions that are most probably due to me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.