Question:
I am working a a project, and I use a function with parameter std::vector<Class*> name
. When I compile, I get an obnoxiously long and difficult to read error, which I am not understanding fully. I think it is telling me it should be std::vector<Class*, std::allocator<Class*>> name
, but upon changing it, I still received the exact same error.
The error is described succinctly as linker command failed with exit code 1.
Repl link:
https://replit.com/@ThomasWarenski/M05-Programming-Assignment
If you cannot access the link, I don’t know why. I haven’t made the repl private or anything, so it should work, but I’ve been having trouble with that lately.
In main.cpp
#include "Menu.h" // All classes included in Menu.h
int main() {
std::vector<Beverage*> drinks;
menu(std::cout, std::cin, drinks);
}
In Menu.h
#include <iostream>
#include <vector>
#include "Coffee.h" // These are all subclasses of Beverage
#include "EnergyDrink.h"
#include "Soda.h"
#include "Tea.h"
void menu(std::ostream &out, std::istream &in, std::vector<Beverage*> drinks);
Thank you anyone and everyone.