[SOLVED] This problem was somehow resolved around 5-6 clean and rebuilt, the code was not changed
I have a class with a standard constructor and a constructor that takes 8 arguments.
from another class, I try to call the constructor and pass 8 parameters, however, when I try to do this, I get LNK2019 Error .
The thing that baffles me is that if I call the default constructor, it compiles nothing and works fine ... everything has the correct values ββand should work, because I can call the default constructor, I use QStrings as some of the arguments, but QString is included, so it cannot be like that ... any other reason why anyone knows why I would like to geta LNK2019 Error for a constructor that takes arguments, and not when its default value:
Car.h
#include <QString> class car { public: car(); car(int car_id, QString something, QString something_else, QString something3, int an_int, int another_int, int another_int_i, QString something4); };
car.cpp
car::car() { } car::car(int car_id, QString something, QString something_else, QString something3, int an_int, int another_int, int another_int_i, QString something4) { }
Obviously, I just deleted the context and values, etc., but has no meaning to the structure
DatabaseController.cpp
#include "DatabaseController.h" #include "car.h" void DatabaseController::DoSomething() { car *pcar = new car(0, "", "", "", 0, 0, 0, ""); }
interface.cpp
#include "DatabaseController.h" void interface::on_btn_clicked() { DatabaseController DC; DC.DoSomething(); }
TOTAL ERROR:
DatabaseController.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall car::car(int,class QString,class QString,class QString,int,int,int,class QString)" ( ??0car@ @ QAE@HVQString @@ 00HHH0@Z ) referenced in function "public: void __thiscall DatabaseController::getAll(class QString)" ( ?getAll@DatabaseController @@ QAEXVQString@ @@Z)