Hi all,
Im learning to program in c++ using online lecture notes at
http://www.doc.ic.ac.uk/~wjk/C++Intro/CourseStructure.html#S1.
While attempting to compile a program with subroutines in seperate files (conversions.h and conversions.cpp) I get the following errors:
/tmp/ccK05p2w.o: In function `print_table(int, int, int)':
a_path/RobMillerEA3-2.cpp:97: undefined reference to `absolute_value_of(int)'
a_path/freek/freek/programmeren/learningc++/lesson3/RobMillerEA3-2.cpp:97: undefined reference to `celsius_of(int)'
collect2: ld returned 1 exit status
This even happens if I import them directly from their website, it is question 2 of lesson 3, the answers are provided. (
http://www.doc.ic.ac.uk/~wjk/C++Intro/RobMillerE3.html).
It seems to me like a library problem, but as I have all my files in the same folder and run the executable from this folder I dont see the problem.
Can someone explain me what I do wrong? Do you get the same errors when using the example answers?
I compile the file in the following way:
g++ -Wall -g file.cpp -o file.x
Thanks
Joop