I’m having some issues at the end of Organizing Functions in Files section of the C++ fundamentals course. No problems are showing in the console, but when I try to run the program I get this
undefined reference to `greet(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
Here is the code in main.cpp
#include "util\greet.hpp"
using namespace std;
int main(){
greet("hi");
return 0;
}
here is the code in greet.cpp
using namespace std;
void greet(string name){
cout << "Hello " << name;
and finally greet.hpp
#define UTIL_GREET
#include <string>
//Function declaration
void greet(std::string name);
#endif
I have checked and made sure the directory in the include statement is correct and even tried the full directory to no avail. I would really appreciate any and all help on this topic.