I'm new to C++ and I'm having some trouble trying to compile my program. I have a Driver.cpp file which contains main(), and 2 header files each with corresponding .cpp files. They are all in the same directory. The Driver.cpp file only calls a function in one of the other header files, which does the rest of the work. My problem is I cannot compile the code as I keep getting "Undefined symbol first referenced in file" errors. I've tried many different ways of writing the compile code but none works. Here is one I tried:
"g++ -lm -o outputfile headerOne.cpp headerTwo.cpp Driver.cpp"
If anyone can help me out I'd greatly appreciate it. Thanks!
Edit: By the way, I tried this code in Visual Studio before I put it into Linux and it worked. Not sure if that means anything, but thought I'd add that in here. Let me know if I need to attach some code.