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

  • SEARCH
  • Home
  • 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 9008255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:54:00+00:00 2026-06-16T01:54:00+00:00

Possible Duplicate: What is an undefined reference/unresolved external symbol error and how do I

  • 0

Possible Duplicate:
What is an undefined reference/unresolved external symbol error and how do I fix it?

Hey i am getting this error in my game. I have a header and .cpp file for Questions, so its obviously in that. but ive been looking through the header and .cpp file and i cannot find the problem. Here is the error:

Error   1   error LNK2019: unresolved external symbol "public: __thiscall Questions::Questions(void)" (??0Questions@@QAE@XZ) referenced in function "void __cdecl `dynamic initializer for 'questions''(void)" (??__Equestions@@YAXXZ)  C:\Users\Conor\Documents\College\DKIT - Year 2 - Repeat\DKIT - Year 2 - Semester 1 - Repeat\Games Programming\Millionaire\Millionaire\Main.obj  Millionaire

Here are the files:

Questions.h
#ifndef QUESTIONS_H
#define QUESTIONS_H
#include <string>
#include <algorithm>
#include <map>
using namespace std;

class Questions
{
public:
    Questions();
    Questions(string question,string correctAnswer, string wrongAnswer1,string wrongAnswer2,string wrongAnswer3);
    void shuffle(string *array, int n);
    string getQuestion();
    string getCorrectAnswer();
    string* getAnswers();
    bool checkAnswer(string answer);
    void questionStore();
    void addQuestion(int level, Questions *question);
    Questions* printQuestion(int level);


private:
    string question;
    string correctAnswer;
    string* pAnswers;
    multimap<int,Questions*> map;

};

#endif

Questions.cpp
#include "Questions.h"
using namespace std;

Questions::Questions(string question,string correctAnswer, string wrongAnswer1,string wrongAnswer2,string wrongAnswer3)
{
    this->question = question;
    this->pAnswers = new string[4];
    this->pAnswers[0]=wrongAnswer1;
    this->pAnswers[1]=wrongAnswer2;
    this->pAnswers[2]=wrongAnswer3;
    this->pAnswers[3] =correctAnswer;
    this->shuffle(this->pAnswers,4);
    this->correctAnswer = correctAnswer;
}

void Questions::shuffle(string *array, int n)
{
    random_shuffle(&this->pAnswers[0],&this->pAnswers[4]);
}

string Questions::getQuestion()
{
    return this->question;
}

string Questions::getCorrectAnswer()
{
    return this->correctAnswer;
}

string* Questions::getAnswers()
{
    return this->pAnswers;
}

bool Questions::checkAnswer(string answer)
{
    if(this->correctAnswer.compare(answer)==0)
    {
        return true;
    }
    return false;
}

void Questions::questionStore()
{
    Questions *q1 = new Questions("Whats the oldest known city in the world?", "Sparta" , "Tripoli" , "Rome", "Demascus");
    Questions *q2 = new Questions("What sport in the olympics are beards dissallowed?", "Judo", "Table Tennis" , "Volleyball", "Boxing");
    Questions *q3 = new Questions("What does an entomologist study?", "People" , "Rocks" , "Plants", "Insects");
    Questions *q4 = new Questions("Where would a cowboy wear his chaps?", "Hat" , "Feet" , "Arms", "Legs");
    Questions *q5 = new Questions("which of these zodiac signs is represented as an animal that does not grow horns?", "Aries" , "Tauris" , "Capricorn", "Aquarius");
    Questions *q6 = new Questions("Former Prime Minister Tony Blair was born in which country?", "Northern Ireland" , "Wales" , "England", "Scotland");
    Questions *q7 = new Questions("Duffle coats are named after a town in which country?", "Austria" , "Holland" , "Germany", "Belgium");
    Questions *q8 = new Questions("The young of which creature is known as a squab?", "Horse" , "Squid" , "Octopus", "Pigeon");
    Questions *q9 = new Questions("The main character in the 2000 movie ""Gladiator"" fights what animal in the arena?", "Panther" , "Leopard" , "Lion", "Tiger");

    addQuestion(1,q1);
    addQuestion(1,q2);
    addQuestion(1,q3);
    addQuestion(2,q4);
    addQuestion(2,q5);
    addQuestion(2,q6);
    addQuestion(3,q7);
    addQuestion(3,q8);
    addQuestion(3,q9);
}

void Questions::addQuestion(int level, Questions *question)
{
    map.insert(pair<int,Questions*>(level,question));
}


Questions* Questions::printQuestion(int level)
{
    multimap<int, Questions*>::iterator it;
    pair<multimap<int, Questions*>::iterator,multimap<int, Questions*>::iterator> ret;

    ret = map.equal_range(level);
    if(ret.first != ret.second)
    {
    size_t sz = distance(ret.first, ret.second);
    size_t idx = rand() % sz;
    advance(ret.first, idx);
    it =ret.first;
    return (*it).second;
    }
    else
    {
        return NULL;
    }
}
  • 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-16T01:54:01+00:00Added an answer on June 16, 2026 at 1:54 am

    You’re declaring Questions::Questions() but didn’t define it.

    Does it need a default constructor? Are you using the default constructor? Does it need any specific implementation?

    In C++11, you can write

    Question() = default;
    

    in the class definition. In C++03, you can provide an empty implementation:

    Question() { }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: What is an undefined reference/unresolved external symbol error and how do I
Possible Duplicate: What is an undefined reference/unresolved external symbol error and how do I
Possible Duplicate: What is an undefined reference/unresolved external symbol error and how do I
Possible Duplicate: What is an undefined reference/unresolved external symbol error and how do I
Possible Duplicate: What is an undefined reference/unresolved external symbol error and how do I
Possible Duplicate: What is an undefined reference/unresolved external symbol error and how do I
Possible Duplicate: What is an undefined reference/unresolved external symbol error and how do I
Possible Duplicate: What is an undefined reference/unresolved external symbol error and how do I
Possible Duplicate: What is an undefined reference/unresolved external symbol error and how do I
Possible Duplicate: What is an undefined reference/unresolved external symbol error and how do I

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.