undefined reference to `compare::searchTwo(QString, QString, QString)'
Hello, I am getting this error, (Linking error, according to what I have read), but I can't figure out how to fix it.
Most people seem to have this trouble when they don't add the .cpp and .h in the .pro file, but I have. I am using Qt 4 on windows with VS C++ 2005 express, and am using VS to build the project.
qmake –project
qmake
make clean
make release
This is the function in the class RoboSearch that is calling a method from another class.
Code:
void RoboSearch::Compare()
{
compare *comp = new compare;
comp->show();
compare::searchTwo("B enrichment - MP - km2.xml", "B Enrichment MP 10-10-5.xml", directory);
}
This is the class declartion of compare in compare.h
Code:
class compare
: public QMainWindow,
private Ui
::compare{
Q_OBJECT
public:
};
And for good measure, here is the .pro file.
Code:
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT += xml
CONFIG += console
RC_FILE = RoboSearch.rc
# Input
HEADERS += compare.h DOM.h readme.h RoboDOM.h RoboSearch.h
FORMS += compare.ui readme.ui RoboSearch.ui
SOURCES += compare.cpp DOM.cpp main.cpp readme.cpp RoboDOM.cpp RoboSearch.cpp
RESOURCES += RoboSearch.qrc
I am new to Qt, and fairly new to programming in general.... Any idea what I'm doing wrong? Thanks!
Re: undefined reference to `compare::searchTwo(QString, QString, QString)'
Where did you implement compare::searchTwo()?
Re: undefined reference to `compare::searchTwo(QString, QString, QString)'
I implemented it in compare.cpp, which has #include <compare.h>. It doesn't do anything right now except return, because I took everything out to try to narrow this problem down.
Re: undefined reference to `compare::searchTwo(QString, QString, QString)'
May we see the implementation? Perhaps you forgot compare:: prefix?
Re: undefined reference to `compare::searchTwo(QString, QString, QString)'
That is exactly what I forgot! thank you very much.