
please wait
|
|
|
|
|
|
||=== CIS225_Midterm, Debug ===| obj/Debug/main.o||In function `readFile(std::vector<cars, std::allocator<cars> >&)' /home/packetpirate/Documents/C++ Projects/CIS225_Midterm/main.cpp|51|undefined reference to `cars::cars(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'| /home/packetpirate/Documents/C++ Projects/CIS225_Midterm/main.cpp|51|undefined reference to `cars::~cars()'| /home/packetpirate/Documents/C++ Projects/CIS225_Midterm/main.cpp|51|undefined reference to `cars::~cars()'| obj/Debug/main.o||In function `std::vector<cars, std::allocator<cars> >::_M_insert_aux(__gnu_cxx::__normal_iterator<cars*, std::vector<cars, std::allocator<cars> > >, cars const&)' /usr/include/c++/4.4/bits/vector.tcc|312|undefined reference to `cars::~cars()'| /usr/include/c++/4.4/bits/vector.tcc|312|undefined reference to `cars::~cars()'| obj/Debug/main.o||In function `__gnu_cxx::new_allocator<cars>::destroy(cars*)' /usr/include/c++/4.4/ext/new_allocator.h|115|undefined reference to `cars::~cars()'| obj/Debug/main.o:/usr/include/c++/4.4/bits/stl_construct.h|83|more undefined references to `cars::~cars()' follow| ||=== Build finished: 7 errors, 0 warnings ===| |
It said there was a problem with the constructor with the parameters. |
car_retail = 0.00;
for example. I am pretty sure that this is an error. It certainly doesn't compile on my system (mingw g++). Neither does car_retail = 0;
for that matter, but the latter may compile on your system depending on your library implementation, and only due to the possible implicit conversion from integer 0 to null pointer. What I am saying is this. Your car.cpp source had errors and the linker was launched still. The linker is only launched if the compiler finishes ok with all the sources. But how can the compilation be fine when one of the source files is erroneous? The only possible explanation for me is that this file was never included in the build and the other files (main.cpp) compiled ok. This explains why the linker can not link to the constructor and destructor definitions (the barks you get). It can not find the compiler result for something that was never compiled.possible implicit conversion from integer 0 to null pointer |
Making those members public is bad practice. |