![]() |
Qt and MADDE next steps
Hi,
I'm trying to learn to write apps for my N900, just for fun and personal interest really. My background is mainly embedded C programming and I have pretty much no experience of programming in Linux. I'm using a Windows PC for the work so initially tried the whole virtual machine method but have now switched to using MADDE and Qt which seems a lot simpler. After following many of the useful guides and posts available here I have managed to write a simple app and run it on the device from within Qt (yay!) but I'm not sure where I need to go from there to get my app running directly on the device. From reading I think I need to build my source code into a package using MADDE, is that correct? I am trying to do that following the "MADDE/Qt example" guide but I am a little confused on what to do exactly. I have created the skeleton project as described, put my source files into it and altered the .pro file to include my files but I get a lot of error messages when I try to make it so I'm obviously doing something wrong. This is the output I get: g++ -c -pipe -O0 -Wall -W -I../../../sysroots/fremantle-arm-sysroot-2.2009-51-1 -qt453/usr/share/qt4/mkspecs/default -I. -Ibuild -o build/main.o src/main.cpp src/main.cpp:1:30: error: QtGui/QApplication: No such file or directory In file included from src/main.cpp:2: src/dialog.h:4:23: error: QMainWindow: No such file or directory In file included from src/main.cpp:2: src/dialog.h:10: error: expected class-name before '{' token src/dialog.h:11: error: ISO C++ forbids declaration of 'Q_OBJECT' with no type src/dialog.h:12: error: expected ';' before 'public' src/dialog.h:16: error: expected `:' before 'slots' src/dialog.h:17: error: expected primary-expression before 'void' src/dialog.h:17: error: ISO C++ forbids declaration of 'slots' with no type src/dialog.h:17: error: expected ';' before 'void' src/dialog.h:20: error: 'QEvent' has not been declared src/main.cpp: In function 'int main(int, char**)': src/main.cpp:6: error: 'QApplication' was not declared in this scope src/main.cpp:6: error: expected `;' before 'a' src/dialog.h:14: error: 'Dialog::~Dialog()' is private src/main.cpp:7: error: within this context src/main.cpp:11: error: 'class Dialog' has no member named 'show' src/main.cpp:13: error: 'a' was not declared in this scope src/main.cpp: At global scope: src/main.cpp:4: warning: unused parameter 'argc' src/main.cpp:4: warning: unused parameter 'argv' make: *** [build/main.o] Error 1 Could someone please tell me firstly if this is the correct route to progress from running the app inside Qt and if so then what I may be doing wrong? Thanks |
Re: Qt and MADDE next steps
Hi,
if you want to compile it for your device you simply have to run: Code:
mad qmake Code:
mad make clean Daniel |
Re: Qt and MADDE next steps
Hi Daniel,
I have run those commands, it is when I run mad make that I get the output as above. Let me check if I have this right: 1. My output from Qt is basically just my source files - (a couple of .cpp files, a .h file, a .ui file and a .pro file) along with all the .o files and a couple of makefiles. 2. I have to create a skeleton project in my MADDE terminal using "mad pscreate -t qt_simple <projectname> 3. I copy my .cpp and .h files to the src directory in the newly created project (removing the created main.cpp and replacing with my own) and copy my .ui file to the uis directory 4. I open the created .pro file and edit it to include the names of my source, header and form (ui) files 5. I cd to the project directory and run mad qmake - works fine 6. run mad make - I get the output as below with an error at the end: Code:
mark.mcdonnell $ mad make Thanks |
Re: Qt and MADDE next steps
Quote:
is even better. |
Re: Qt and MADDE next steps
1 Attachment(s)
Ok, this is my complete MADDE project folder after trying unsuccessfully to run the mad make command.
Thanks |
Re: Qt and MADDE next steps
Quote:
mad qmake and compilation succeeded. |
Re: Qt and MADDE next steps
Yes you're right, that works for me too. I thought I had to put a \ between listed files as that is what QtCreator has done in its project file, my mistake.
Thanks very much |
Re: Qt and MADDE next steps
You only need the \ if the list continues on the next line.
|
Re: Qt and MADDE next steps
Quote:
|
All times are GMT. The time now is 09:19. |
vBulletin® Version 3.8.8