Sorry.Here's my test.h file
#ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
using namespace std;
namespace Ui {
class calc;
}
Q_OBJECT
public:
~calc();
protected:
private:
Ui::calc *ui;
private slots:
public slots:
int appendone();
};
#endif // WIDGET_H
#ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
using namespace std;
namespace Ui {
class calc;
}
class calc : public QWidget {
Q_OBJECT
public:
calc(QWidget *parent = 0);
~calc();
protected:
private:
Ui::calc *ui;
private slots:
public slots:
int appendone();
};
#endif // WIDGET_H
To copy to clipboard, switch view to plain text mode
I created an object for calc in my C++ file
calc c;
calc c;
To copy to clipboard, switch view to plain text mode
Now I'm getting the following error
/home
/anil
/Tests
/Qt
/test
/test.
cpp:10: undefined reference to `calc
::calc(QWidget*)' /home/anil/Tests/Qt/test/test.cpp:10: undefined reference to `calc::~calc()'
collect2: ld returned 1 exit status
make: *** [test] Error 1
/home/anil/Tests/Qt/test/test.cpp:10: undefined reference to `calc::calc(QWidget*)'
/home/anil/Tests/Qt/test/test.cpp:10: undefined reference to `calc::~calc()'
collect2: ld returned 1 exit status
make: *** [test] Error 1
To copy to clipboard, switch view to plain text mode
Bookmarks