I have a custom-defined library (and corresponding cpp file) included by a test file. When I try to call the function in the test file, it gives me the error, "Undefined reference to < function name>." I'm not very experienced with putting stuff in library files, so any help is appreciated.
input.h
#ifndef LOC_H
#define LOC_H
#include<vector>
struct loc{
int room, row, col;
char c;
bool stacked;
//loc *north, *east, *south, *west;
};
#endif
void Input(std::vector<std::vector<std::vector<loc> > > &b, loc & start);
input.cpp
#include<iostream>
#include<cstdlib>
#include<unistd.h>
#include<getopt.h>
#include "input.h"
using namespace std;
void Input(vector<vector<vector<loc> > > &b, loc & start) {
//Do stuff
}
test.cpp
#include<iostream>
#include "input.h"
#include<vector>
using namespace std;
int main(int argc, char* argv[]) {
vector<vector<vector<loc> > > building;
loc start = {0, 0, 0, '.', false};
Input(building, start);
}