Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, September 2002
cross-compiling


Message 1 in thread

Hello All,

I have created an application using the Qt/X11 SDK and Qt Designer (project consists of one Form and couple of functions written through the Qt Designer application).
My motive is to cross-compile this application to run on the Sharp Zaurus device. Below are the steps I have taken to do the same and errors I have come across. 

My main function is as follows:--

#include <qapplication.h>
#include "Reader.h" //contains definition of class ReaderForm  

int main( int argc, char ** argv )
{
    QApplication a( argc, argv );
    ReaderForm *w = new ReaderForm;
    w->show();
    a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
    return a.exec();
}

My ProjectName.pro

SOURCES	+= main.cpp txt2pdbdoc.cpp 
HEADERS	+= palm.h txt2pdbdoc.h 
######################################################################
# Automatically generated by qmake (1.02a) Thu Sep 5 15:30:55 2002
######################################################################

# Input
HEADERS += palm.h Reader.ui.h txt2pdbdoc.h
FORMS	= Reader.ui 
TEMPLATE	=app
CONFIG	+= qt warn_on release
DBFILE	= DOCReader.db
LANGUAGE	= C++


Now I want to cross-compile this application for the Sharp Zaurus device. I have downloaded the following packages on my PC(running on RedHat Linux) and also set the environment variables as suggested.

1) http://www.trolltech.com/developer/download/qtopia.html
2) filename:  http://more.sbc.co.jp/slj/tool/gcc-cross-sa1100-2.95.2-0.i386.rpm   (gcc compiler for ARM architecture)
3) filename:  http://more.sbc.co.jp/slj/tool/binutils-cross-arm-2.11.2-0.i386.rpm  (binary utilities for ARM architecture)
4) filename:  http://more.sbc.co.jp/slj/tool/glibc-arm-2.2.2-0.i386.rpm    (GNU C libraries for ARM architecture)
5) filename:  http://more.sbc.co.jp/slj/tool/linux-headers-arm-sa1100-2.4.6-3.i386.rpm (linux header files for ARM architecture)

The problem is as below
When  I try compiling for SHARP ARM, the following happens:---
1) tmake -o Makefile ProjectName.pro-----this works fine
2) make --- on this it gives an error as follows---

main.o: In undefined refernce to 'ReaderForm::ReaderForm(QWidget*, char const *, bool, unsigned int)
collect2: ld returned 1 exit status 


Apparently its not able to read the Reader.h file or the Form designed in Qt Designer...is this the matter. Or is this due to the fact that am using Qt designer to write my SLOT functions??? Do I need to create applications using only the Qtopia SDK?

Thanks in advance,

Priti. 


Message 2 in thread

On Thursday, Sep 5, 2002, at 03:26 US/Pacific, Priti Adam wrote:
> My main function is as follows:--
>
> #include <qapplication.h>
> #include "Reader.h" //contains definition of class ReaderForm
>
> int main( int argc, char ** argv )
> {
>     QApplication a( argc, argv );
>     ReaderForm *w = new ReaderForm;
>     w->show();
>     a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
>     return a.exec();
>
I suspect you built this with the Qt 3.0.x  tools. You need to use the  
Qtopia tools, Designer et rest as Qtopia is based on Qt 2.3.x. For  
example, it's not called QApplication, it's QPEApplication. You could  
get started by building the example that is part of the Qtopia 1.5 SDK.  
You still need to download the Sharp Zaurus cross-compile  
tools/libraries:

http://www.zauruszone.farplanet.net/howtos/ 
linux_compiler_setup_howto.shtml


  --Kent