I'm on chapter 6.34 of "Programming: Principles and Practice Using C++" by Bjarne.
Anyways, i'm learning about tokens and how to use them. It's all confusing, rushed, and just thrown at the reader (me), but it's ok. i'm grasping the concept and the need of them to complete the "calculator" program. I usually just follow along and just write the code into my compiler and follow along, getting the errors that the book intends us to get and then fix them. However, when i was writing out the Token code I get the error "Apple Mach-O linker (ld) Error "get_token reference()" reference" "Undefined symbols for architecture x86_64:
"get_token()", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)"
... I have no idea of what this means. or how to fix it. can any one help me?
Btw, i'm coding with a Macbook, using xCode as my compiler. Does my machine have anything to do with this?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#include<iostream>
#include<istream>
#include<fstream>
#include "std_lib_facilities.h"
using namespace std;
class Token{
public:
char kind;
double value;
Token(char ch)
:kind(ch),value(0){}
Token(char ch, double val)
:kind(ch), value(val){}
};
Token get_token();
vector<Token>tok;
int main()
{
while (cin){
Token t=get_token();
tok.push_back(t);
}
}
|