Пишу простую программу в Qt Designer. В ней три файла: first.pro, main.cpp, maindlg.ui
first.pro:
---------------
unix {
UI_DIR = .ui
MOC_DIR = .moc
OBJECTS_DIR = .obj
}
TEMPLATE = app
LANGUAGE = C++
CONFIG += qt warn_on release
SOURCES += main.cpp
FORMS = maindlg.ui
---------------
main.cpp:
---------------
#include <qapplication.h>
#include <qfiledialog.h>
#include <qstring.h>
#include "maindlg.h"
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
MainForm w;
w.show();
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
}
void MainForm::encode()
{
QString fname = QFileDialog::getOpenFileName();
if (fname != NULL){
FileName->clean();
FileName->insert(fname);
}
//add more...
}
-------------
Проблема такая. Делаю:
qmake
make
/usr/lib/qt/bin/uic maindlg.ui -o .ui/maindlg.h
g++ -c -pipe -Wall -W -O2 -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT -I/usr/lib/qt/mkspecs/default -I. -I/usr/lib/qt/include -I.ui/ -I. -I.moc/ -o .obj/main.o main.cpp
main.cpp: In member function `virtual void MainForm::encode()':
main.cpp:19: invalid use of undefined type `struct QLineEdit'
/usr/lib/qt/include/qfiledialog.h:48: forward declaration of `struct QLineEdit'
main.cpp:20: invalid use of undefined type `struct QLineEdit'
/usr/lib/qt/include/qfiledialog.h:48: forward declaration of `struct QLineEdit'
make: *** [.obj/main.o] Ошибка 1
Вот так :(
А на 48-ой строке в qfiledialog.h написано так:
class QLineEdit;
Ответ на:
комментарий
от anonymous
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.
Похожие темы
- Форум как сделать второе окно (2005)
- Форум Ошибки в Qt связаные с Q_OBJECT ... помогите плз!!! (2003)
- Форум QT + setCursor (2004)
- Форум создание двупоточного приложения (2005)
- Форум QT4 и ui файлы (2008)
- Форум Проблемы с компиляцией qt (2001)
- Форум sublime text 2 , c++ и undefined reference to <function> (2020)
- Форум QT и Я (2005)
- Форум Глобальные переменные (2005)
- Форум C++ (2003)