Hello,
I would like to get your thoughts on the following linker errors I am getting for the code segment reproduced below. The code was compiled using the following command on macOS High Sierra 10.13.2:
g++ -ggdb -Wall -std=c++11 database.cpp error.cpp func_objs.cpp main.cpp sampler.cpp -o DB_sampler
The following are the linker errors that I get:
Undefined symbols for architecture x86_64:
"sampler<database>::generate_sample()", referenced from:
_main in main-585927.o
"sampler<database>::sampler(database const&, double)", referenced from:
_main in main-585927.o
"func_objs::create_db_from_file<database>::create_db_from_file(database&)", referenced from:
database::read_from_file() in database-d7bc7e.o
"func_objs::create_db_from_file<database>::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
database::read_from_file() in database-d7bc7e.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 shared at the below link, the source code from the various source files (and the corresponding header files) included in the command line above. The program is intended to sample a database (contained in a file on the disk). I am presuming that the design would be evident from the source code.
https://drive.google.com/open?id=1NmJcsM4AhqEJRiGqPWsB5Pa8FreTPMW5
I would really appreciate your thoughts.
TIA
Vin