QT 처음사용해보는 초보입니다 이게 왜이런건지...
아예 다 에러가 나네요
hello.cpp:1:26: error: qapplication.h: 그런 파일이나 디렉토리가 없음
hello.cpp:3:20: error: qlabel.h: 그런 파일이나 디렉토리가 없음
hello.cpp: In function ‘int main(int, char**)’:
hello.cpp:11: error: ‘QApplication’ was not declared in this scope
hello.cpp:11: error: expected `;' before ‘app’
hello.cpp:13: error: ‘QLabel’ was not declared in this scope
hello.cpp:13: error: ‘hello’ was not declared in this scope
hello.cpp:13: error: expected type-specifier before ‘QLabel’
hello.cpp:13: error: expected `;' before ‘QLabel’
hello.cpp:17: error: ‘app’ was not declared in this scope
[root@jsydev NewPVViewer]# gcc -c hello.cpp -l$QTDIR/include
hello.cpp:1:26: error: qapplication.h: 그런 파일이나 디렉토리가 없음
hello.cpp:3:20: error: qlabel.h: 그런 파일이나 디렉토리가 없음
hello.cpp: In function ‘int main(int, char**)’:
hello.cpp:11: error: ‘QApplication’ was not declared in this scope
hello.cpp:11: error: expected `;' before ‘app’
hello.cpp:13: error: ‘QLabel’ was not declared in this scope
hello.cpp:13: error: ‘hello’ was not declared in this scope
hello.cpp:13: error: expected type-specifier before ‘QLabel’
hello.cpp:13: error: expected `;' before ‘QLabel’
hello.cpp:17: error: ‘app’ was not declared in this scope
지금 인턴으로 뷰어(이미 만들어져있는걸 소스만 조금 바꿔서 업데이트하는작업) 을 개발 하고 있는데 줄마다 에러가 떠서 걍 기초적인 걸 시험삼아 컴파일 시켜봤는데 이것도 마찬가지이네요
os는 페도라 리눅스 7.0이고요 큐티 버전은 QT4 4.3.2.
이네여 참고삼으시라고 제가 한 기초적인 소스도 올려봅니다.
#include
#include
int main( int argc, char **argv )
{
QApplication app( argc, argv );
QLabel *hello = new QLabel( "Hello Qt!"
"", 0 );
app.setMainWidget( hello );
hello->show();
return app.exec();
}
~
qmake를 이용하여
qmake를 이용하여 Makefile 만든 다음 make하세요.
적으신 코드는 Qt3용
적으신 코드는 Qt3용 코드이고, Qt4에서는 Qt3용 코드는 별도의 옵션없이는 컴파일이 안됩니다.
Qt4를 이용하실거라면 Qt4를 공부하세요.
환경 설정이...
환경 설정이 잘못되어 있는 것 같습니다.
앞에서 말씀하신데로 소스코드는 Qt3로 되어있고 헤더파일과 라이브러리는 Qt4를 참고할려고 하네요.
QTDIR 환경변수가 어디를 가르키는지 확인해보시는 것이 좋을 것 같습니다.
-------------------------------------
서영진 입니다.
Homepage : http://valentis.pe.kr
blog : http://www.lifeholic.com
-------------------------------------
서영진 입니다.
Homepage : http://valentis.pe.kr
blog : http://www.lifeholic.com
댓글 달기