View Single Post
Posts: 24 | Thanked: 12 times | Joined on Mar 2010
#1
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