Hi all I'm new here.
I have installed Code::Blocks and Qt 4.5.0; I have setup Global variables and the top level folders of mingw compiler and qt libraries. Now I'm ready to do new Project-->Qt4project but i have some problems:
1) If I build my code (whichever it be) I obtain this error: "QtCore4.dll not found"... the only way I found To solve this issue is to copy the QtCore4.dll on C:\Windows\System32... Is there another way?
2) If I try to build the tutorial example GUI:
addressbook.h file:
#ifndef ADDRESSBOOK_H
#define ADDRESSBOOK_H
#include <QWidget>
class QLabel;
class QLineEdit;
class QTextEdit;
class AddressBook : public QWidget
{
Q_OBJECT
public:
AddressBook(QWidget *parent = 0);
private:
QLineEdit *nameLine;
QTextEdit *addressText;
};
#endif
addressbook.cpp file:
#include <QtGui>
#include "addressbook.h"
AddressBook::AddressBook(QWidget *parent) : QWidget(parent)
{
QLabel *nameLabel = new QLabel(tr("Name:"));
nameLine = new QLineEdit;
QLabel *addressLabel = new QLabel(tr("Address:"));
addressText = new QTextEdit;
QGridLayout *mainLayout = new QGridLayout;
mainLayout->addWidget(nameLabel, 0, 0);
mainLayout->addWidget(nameLine, 0, 1);
mainLayout->addWidget(addressLabel, 1, 0, Qt::AlignTop);
mainLayout->addWidget(addressText, 1, 1);
setLayout(mainLayout);
setWindowTitle(tr("Simple Address Book"));
}
main.cpp file:
#include <QApplication>
#include <QFont>
#include <QPushButton>
#include <QtGui>
#include <QWidget>
#include "addressbook.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
AddressBook *addressBook = new AddressBook;
addressBook->show();
return app.exec();
}
I Obtain "Undefined reference to 'AddressBook::AddressBook(QWidget*)'....
Can someone help me???
Thanks