Hello,
I am trying to compile a set of files. I got fustrated to the point of taking the actually instructor files from the book and compiled them. I am using AndLinux and the g++ compile to run my programs. If anyone is familiar with the book "Accelerated C++" I am in Chapter 4. Let me first start by the error I am getting from my terminal.

/tmp/ccphpsfl.o: In function `main':
main3.cc:(.text+0xd7): undefined reference to `read(std::basic_istream<char, std::char_traits<char> >&, Student_info&)'
main3.cc:(.text+0x126): undefined reference to `compare(Student_info const&, Student_info const&)'
main3.cc:(.text+0x236): undefined reference to `grade(Student_info const&)'
collect2: ld returned 1 exit status

I have attached the files that are required to work for the main3.cpp file. I have listed my errors and am a little lost, because we are suppose to manipulate the code after this is done. I cannot do that until this is fixed. Can someone please compile and maybe see what I have done wrong. *Note: these are instructor files from the book*

/tmp/ccphpsfl.o: In function `main':
main3.cc:(.text+0xd7): undefined reference to `read(std::basic_istream<char, std::char_traits<char> >&, Student_info&)'
main3.cc:(.text+0x126): undefined reference to `compare(Student_info const&, Student_info const&)'
main3.cc:(.text+0x236): undefined reference to `grade(Student_info const&)'
collect2: ld returned 1 exit status

You are compiling the main3.cc file without the other files it depends on. Use a makefile or list all the files when running the compiler

gcc main.cc grade.cpp median.cpp

I have attached the files that are required to work for the main3.cpp file.

Read the FAQ. Minimizing the code you post to the part that is broken will get you the quickest response.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.