When I run the following command I get an error as displayed below:
1 2 3 4
~/Desktop/Cs315/binary$ g++ -g test.cc binary.cc
/tmp/cctzzWZ5.o: In function `main':
/home/david/Desktop/Cs315/binary/test.cc:19: undefined reference to `binary::add(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: ld returned 1 exit status
I can not figure out what I have done wrong here, The code is as follows:
//binary.cc
//I can include more of the code if it is deemed necessary.
#include<iostream>
#include<cmath>
#include<vector>
usingnamespace std;
#include "binary.h"
vector<int> binary::dectobin(int dec){
//...
}
int binary::bintodec(vector<int> bin){
//...
}
vector<int> add(vector<int> A,vector<int> B){
//...
}
vector<int> convertIntToVector(int A){
//...
}