SHARE
TWEET

Untitled

a guest Mar 20th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Undefined symbols for architecture x86_64:
  2.       "Question::display()", referenced from:
  3.       _main in QuizDriver-e52a2c.o
  4.       "Question::getKey() const", referenced from:
  5.       _main in QuizDriver-e52a2c.o
  6.     ld: symbol(s) not found for architecture x86_64
  7.     clang: error: linker command failed with exit code 1 (use -v to see invocation)
  8.    
  9. #include <iostream>
  10. #include <iomanip>
  11. using namespace std;
  12.  
  13. #include "Question.h"
  14.  
  15. int main()
  16. {
  17.     Question q1;
  18.     Question q2;
  19.     Question q3;
  20.     Question q4;
  21.     string q1Stem = "1. What name is given to half of a Byte (4 bits)?";
  22.     string q1Answers [] = {"Nibble","Ort","Scrap","Snippet"}; //answer A
  23.     string q2Stem = "2. Which country is home to the Kangaroo?";
  24.     string q2Answers [] = {"China","India","Mexico","Australia"}; //answer D
  25.     string q3Stem = "3. What do you use to measure an angle?";
  26.     string q3Answers [] = {"Compass","Protractor","Ruler","T-Square"}; //ans B
  27.     string q4Stem =
  28.     "4. The Great Sphinx has the head of a human and the body of a what?";
  29.     string q4Answers [] = {"Camel","Eagle","Lion","Alligator"}; //answer C
  30.     string q5Stem =
  31.     "5. What is the flat rubber disc used in a game of ice hockey?";
  32.     string q5Answers [] = {"Birdie","Puck","Dart","Tile"}; //answer B
  33.  
  34.     q1.display();
  35.     cout << endl;
  36.     q2.display();
  37.     cout << endl;
  38.     q3.display();
  39.     cout << endl;
  40.     q4.display();
  41.     cout << endl;
  42.  
  43.     cout << "Answers:" << endl;
  44.     cout << q1.getKey() << " " << q2.getKey() << " " << q3.getKey() <<
  45.     " " << q4.getKey() << endl;
  46.  
  47.     return 0;
  48. }
  49.    
  50. #include <string>
  51. using namespace std;
  52.  
  53. class Question
  54. {
  55. public:
  56.     string stem;
  57.     string answers[4];
  58.     char key;
  59.     void setStem(string);
  60.     string getStem() const;
  61.     void setAnswers(string []);
  62.     string getAnswer(int);
  63.     void setKey(char);
  64.     char getKey() const;
  65.  
  66.     void display();
  67. };
RAW Paste Data
Top