Author Topic: Qtpoia SDK problems  (Read 29675 times)

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Qtpoia SDK problems
« Reply #15 on: March 02, 2004, 04:48:11 am »
Going back to all of your problems with setting LD_LIBRARY_PATH......

I\'m sure you all noted that there are two sets of instructions, the first set is to compile a native application which will run on your x86 Linux machine (these instructions tell you to set LD_LIBRARY_PATH), the second set (which doesn\'t set LD_LIBRARY_PATH) is for cross-compiling.


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

markb

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
    • http://
Qtpoia SDK problems
« Reply #16 on: March 02, 2004, 03:04:38 pm »
I think the problems we\'ve been having are due to the environment setup scripts and configuration files.

Even though the 2nd set of instructions doesn\'t explicitly tell you to set LD_LIBRARY_PATH, it gets set anyway when you run the dev-arm-qpe.sh script.
Unfortunately it sets it in such a way that it stops you from running commands in the shell. :-(

And the tmake.conf file that gets installed seems to be incorrect too. It misses out some libraries, and includes some that aren\'t available on the Zaurus.

As I mentioned in a previous post, it all seemed to work first time without any tweaking when I went through this a year or two ago.
But I had to download all the tools and scripts again on my new PC, and it didn\'t go as smoothly this time.
Maybe there are different versions available, and we got the wrong ones?

Still, two minor edits isn\'t much to complain about.  :-)
It\'s still fairly easy to get up an running.

I\'m looking forward to seeing what jdf and jay produce for the Zaurus.
But not as much as I\'m looking forward to getting my C860 in the post. :-)

Hopefully this week!
(Come on ShirtPocket, don\'t let me down)
:-)


- Mark

jay

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • http://
Qtpoia SDK problems
« Reply #17 on: March 02, 2004, 10:23:18 pm »
Yes, the problem is due to the scripts.  The setup scripts for the ARM compile do modify LD_LIBRARY_PATH to point to /opt/Qtopia/lib.  Unfortunately, tmake runs on x86, and uses perl, which is searching for /lib/libc.so.6.  Because of the LD_LIBRARY_PATH is changed, the x86 perl job is trying to reference the ARM libc.so.6 library.  

I agree this may not be the best approach.  (Certainly isn\'t clean.)  Yes, there are work-arounds, but what exactly *is* the \"correct\" solution here?  If you are not using LD_LIBRARY_PATH for your system, how do you tell the compiler where you should be picking up the libraries from?  

Sorry if this is a gcc101 question.  My experience is in Unix software support,  not development.  LD_LIBRARY_PATH is used for a great many commercial applications, and I wasn\'t aware there are methods of getting around it.  Any constructive input would be appreciated.

Thanks!

jdf

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • http://
Qtpoia SDK problems
« Reply #18 on: March 03, 2004, 12:18:51 am »
Yes the scripts had to be changed for whatever reason.  I am a civil engineer with not much experience in linux or cpp but I have written programs in C as a hobby and long ago in quickbasic.   I caved in and bought the \"programming with QT 3\" book today which came with a cd for Windows and a borland cpp compiler.  I think it will be easier for me to get up to speed and learn on windows then move my developed apps to linux and then to zaurus.  Interestingly, the compiler wouldn\'t work despite following the book directions exactly.   It wasn\'t finding a lib.  Based on my experience here I knew right where to go!!  I had to change the \"qmake\" configuration files much like we had to do here!!  Anyway, I would have never figured out how to fix the windows version if I hadn\'t learned how to fix the linux version from you all!!
JDF
JDF
SL-5500; CF MODEM; CF Wireless; CF & SD Storage;
Fedora CORE 1; WinXP

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Qtpoia SDK problems
« Reply #19 on: March 03, 2004, 05:27:35 am »
LD_LIBRARY_PATH should not be altered for a cross compile. The compiler itself knows that it should look in ../lib relative to itself (and so on) to find the lib files.

I can cross-compile quite happily using the following source script.
To do Qtopia stuff just add in the QPEDIR=/opt/Qtopia, QTDIR=/opt/Qtopia part assuming that\'s where they are - and they are by default)

=======================================
#!/bin/bash

CC=arm-linux-gcc
CXX=arm-linux-g++
CCX=arm-linux-gcc
CXXX=arm-linux-g++
COMPILER=arm-linux-gcc
LINKER=arm-linux-g++
G77=arm-linux-g77
F77=arm-linux-g77

PATH=/usr/local/arm/3.3.2/bin:/usr/local/arm/3.3.2/arm-linux/bin:$PATH

PS1=\'!OZ-dev-armu@h:w$ \'

export PATH CC CXX CCX CXXX COMPILER LINKER G77 F77
echo \"Altered environment for OZ 3.3.2 Development\"
========================================

Take a look at this thread: http://zaurususergroup.com/index.php?name=...ource+devarm%2A

Although it\'s for OZ and for GCC3.x it\'s the same idea. You just alter the PATH so that the gcc, ld, etc which are used are the cross-toolchain ones. No need to alter LD_LIBRARY_PATH - and in any case why would you want to alter the path which Linux uses to *load* libraries (not to link them).


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

markb

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
    • http://
Qtpoia SDK problems
« Reply #20 on: March 03, 2004, 02:20:53 pm »
It would be nice to get a fixed version of the dev-arm-qpe.sh script put into the download area, with the troublesome LD_LIBRARY_PATH bit removed. Just so other people don\'t come across the same problems.

https://www.oesf.org/downl.../dev-arm-qpe.sh

- Mark

jdf

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • http://
Qtpoia SDK problems
« Reply #21 on: March 05, 2004, 08:42:09 pm »
This  qtopia-free-1.7.0-2rh9.i386.rpm only had 1 example program, which doesn\'t do much.  

Where can I get the rest of the examples?

I really can\'t get much further unless I get those examples..... :cry:  so that I can learn.

I have the examples from the 3.3 release for windows which differ slightly from the older releases and I get errors when I compile them, but they compile fine on windows.

For example the \"tictac\" program:
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -DNO_DEBUG -I. -I/opt/Qtopia/include -o main.o main.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -DNO_DEBUG -I. -I/opt/Qtopia/include -o tictac.o tictac.cpp
/opt/Qtopia/bin/moc tictac.h -o moc_tictac.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -DNO_DEBUG -I. -I/opt/Qtopia/include -o moc_tictac.o moc_tictac.cpp

gcc  -o tictac main.o tictac.o moc_tictac.o  -L/opt/Qtopia/lib -lm -lqte
/opt/Qtopia/lib/libqte.so: undefined reference to `QWizard::staticMetaObject()\'
collect2: ld returned 1 exit status
make: *** [tictac] Error 1


JDF
JDF
SL-5500; CF MODEM; CF Wireless; CF & SD Storage;
Fedora CORE 1; WinXP

markb

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
    • http://
Qtpoia SDK problems
« Reply #22 on: March 06, 2004, 02:57:37 pm »
Hi jdf,

I\'ll have a go and see if I can reproduce your problem.
But I\'ll need to get hold of the source first.
If you happen to know where I can download it, it would be a big help.

I can see it on the trolltech site, here:
http://doc.trolltech.com/3.3/tictac-example.html
But I don\'t know if that\'s the same as yours. And it would be nice to get the same project file as you in case it\'s a config problem.


I have noticed one thing though.
The last line of the build, where it does the final link:
Code: [Select]
gcc -o tictac main.o tictac.o moc_tictac.o -L/opt/Qtopia/lib -lm -lqte

It only specifies qte and not qpe and qtopia.
Maybe it should say:

Code: [Select]
gcc -o tictac main.o tictac.o moc_tictac.o -L/opt/Qtopia/lib -lm -lqte -lqpe -lqtopia

It\'s just a guess. But worth a try. :-)

- Mark

p.s.
If you haven\'t tried it already, you may want to try regenerating your Makefile.
e.g.

make clean
tmake -o Makefile *.pro

and then try re-building.

jdf

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • http://
Qtpoia SDK problems
« Reply #23 on: March 06, 2004, 03:37:52 pm »
markb,

Problem solved.
Thankx. Yes the source is same as your link.  
I had already make clened and remade Makefiles several times and each time got the same error.
Based on your observation about the libs, I looked at the .pro files.    That is the source of problem.  I thought these were autogenerated by qmake somehow.
In any case, i edit the .pro file to have same options as the example.pro, and I am back in business!!  
*********************************************
BAD tictac.pro file:
 TEMPLATE = app
 INCLUDEPATH += .
  # Input
 HEADERS += tictac.h
 SOURCES += main.cpp tictac.cpp
*********************************************
GOOD tictac.pro file:
 TEMPLATE        = app
 HEADERS += tictac.h
 SOURCES += main.cpp tictac.cpp
 #CONFIG         += qtopia warn_on debug
 CONFIG          += qtopia warn_on release
 TARGET          = tictac

I tried the same fix on 4 other sample programs and ALL IS WORKING FINE NOW!!!!   Thankx for the clue.

jdf
JDF
SL-5500; CF MODEM; CF Wireless; CF & SD Storage;
Fedora CORE 1; WinXP

Matthieu

  • Newbie
  • *
  • Posts: 13
    • View Profile
Qtpoia SDK problems
« Reply #24 on: March 31, 2005, 11:48:33 am »
Hi everybody,
I put up this topic because it is really interesting.
I've got a question to all of the persons which understand this topic.

I made an application with qt and now I'm changing it to qtopia, in order to put it on a zaurus.

I post the code a this application, I've got an erroer during the compilation.

arm-linux-g++ -c -pipe -DQT_QWS_SL5XXX -DQT_QWS_CUSTOM -DQWS -fno-exceptions -fno-rtti -Wall -W -                O2 -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/sharp/include -o main.o main.cpp
arm-linux-g++ -c -pipe -DQT_QWS_SL5XXX -DQT_QWS_CUSTOM -DQWS -fno-exceptions -fno-rtti -Wall -W -                O2 -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/sharp/include -o compass.o compass.c                pp
arm-linux-g++ -c -pipe -DQT_QWS_SL5XXX -DQT_QWS_CUSTOM -DQWS -fno-exceptions -fno-rtti -Wall -W -                O2 -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/sharp/include -o map.o map.cpp
arm-linux-g++ -c -pipe -DQT_QWS_SL5XXX -DQT_QWS_CUSTOM -DQWS -fno-exceptions -fno-rtti -Wall -W -                O2 -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/sharp/include -o MyThread.o MyThread                .cpp
arm-linux-g++ -c -pipe -DQT_QWS_SL5XXX -DQT_QWS_CUSTOM -DQWS -fno-exceptions -fno-rtti -Wall -W -                O2 -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/sharp/include -o process.o process.c                pp
/opt/Qtopia/sharp/bin/moc compass.h -o moc_compass.cpp
arm-linux-g++ -c -pipe -DQT_QWS_SL5XXX -DQT_QWS_CUSTOM -DQWS -fno-exceptions -fno-rtti -Wall -W -                O2 -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/sharp/include -o moc_compass.o moc_c                ompass.cpp
/opt/Qtopia/sharp/bin/moc map.h -o moc_map.cpp
arm-linux-g++ -c -pipe -DQT_QWS_SL5XXX -DQT_QWS_CUSTOM -DQWS -fno-exceptions -fno-rtti -Wall -W -                O2 -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/sharp/include -o moc_map.o moc_map.c                pp
/opt/Qtopia/sharp/bin/moc process.h -o moc_process.cpp
arm-linux-g++ -c -pipe -DQT_QWS_SL5XXX -DQT_QWS_CUSTOM -DQWS -fno-exceptions -fno-rtti -Wall -W -                O2 -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/sharp/include -o moc_process.o moc_p                rocess.cpp
arm-linux-gcc  -o gpus main.o compass.o map.o MyThread.o process.o moc_compass.o moc_map.o moc_pr                ocess.o  -L/opt/Qtopia/sharp/lib -ljpeg -luuid -lqte-mt -lpthread
/opt/Embedix/tools/arm-linux/bin/ld: cannot find -lqte-mt
collect2: ld returned 1 exit status
make: *** [gpus] Erreur 1


I follow the topic and success the compilation of example, I try it on Z and it's good.

the problem is with lqte.

I use a thread in my code.

TimW

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
Qtpoia SDK problems
« Reply #25 on: March 31, 2005, 11:53:45 am »
You need -lqte *not* -lqte-mt

The version of QT on the Zaurus is not the multithreaded one. This doesn't mean that you can't use threads but only one thread is allowed to do any gui work.

If you have asked for threads in the CONFIG section you should remove it - this will change the -lqte-mt to -lqte

Matthieu

  • Newbie
  • *
  • Posts: 13
    • View Profile
Qtpoia SDK problems
« Reply #26 on: March 31, 2005, 04:31:54 pm »
Thanks TimW,
I have no more the problem after have erase thread from gpus.pro.

But, I've got one more problem, but I think it's a problem of understanding .
Indeed, I've got a gpus.ui and I want to include gpus.h in my main.cpp.
gpus.h is created by qt,.

I hope you understand my problem of comprehension in order to explain me how I can do this.

don't forget that I put my code in a precedent answer.

Thanks,
Matthieu.

Matthieu

  • Newbie
  • *
  • Posts: 13
    • View Profile
Qtpoia SDK problems
« Reply #27 on: April 02, 2005, 09:23:56 am »
Hi,

I have to use a thread in my application written in qt, and I'm changing it to qtopia 1.7

if i write : CONFIG += qtopia warn_on release
in my gpus.pro

I've got this error :

MyThread.h:5: error: erreur d'analyse syntaxique before `{' token

#ifndef MYTHREAD_H
#define MYTHREAD_H
#include <qthread.h>

class MyThread : public QThread{
 
 public:
  virtual void run();
};

#endif

--> I think it doesn't find qthread.h

---------------------------------------------------------------------------

if if i write : CONFIG += qtopia warn_on release thread
in my gpus.pro

I've got this error :

pc3c15:/v3# make
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/include -I/opt/Qtopia/include -o main.o main.cpp
main.cpp:18:2: attention : pas de retour chariot à la fin du fichier
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/include -I/opt/Qtopia/include -o compass.o compass.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/include -I/opt/Qtopia/include -o map.o map.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/include -I/opt/Qtopia/include -o process.o process.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/include -I/opt/Qtopia/include -o gpusui.o gpusui.cpp
gpusui.cpp:118:2: attention : pas de retour chariot à la fin du fichier
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/include -I/opt/Qtopia/include -o MyThread.o MyThread.cpp
MyThread.cpp:159:43: attention : pas de retour chariot à la fin du fichier
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/include -I/opt/Qtopia/include -o gpus.o gpus.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/include -I/opt/Qtopia/include -o settingsdialog.o settingsdialog.cpp
/opt/Qtopia/bin/moc compass.h -o moc_compass.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/include -I/opt/Qtopia/include -o moc_compass.o moc_compass.cpp
/opt/Qtopia/bin/moc map.h -o moc_map.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/include -I/opt/Qtopia/include -o moc_map.o moc_map.cpp
/opt/Qtopia/bin/moc process.h -o moc_process.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/include -I/opt/Qtopia/include -o moc_process.o moc_process.cpp
/opt/Qtopia/bin/moc gpusui.h -o moc_gpusui.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/include -I/opt/Qtopia/include -o moc_gpusui.o moc_gpusui.cpp
/opt/Qtopia/bin/moc gpus.h -o moc_gpus.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/include -I/opt/Qtopia/include -o moc_gpus.o moc_gpus.cpp
/opt/Qtopia/bin/moc settingsdialog.h -o moc_settingsdialog.cpp
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -fno-default-inline -D_REENTRANT -DNO_DEBUG -DQT_THREAD_SUPPORT -I/opt/Qtopia/include -I/opt/Qtopia/include -o moc_settingsdialog.o moc_settingsdialog.cpp
gcc  -o gpus main.o compass.o map.o process.o gpusui.o MyThread.o gpus.o settingsdialog.o moc_compass.o moc_map.o moc_process.o moc_gpusui.o moc_gpus.o moc_settingsdialog.o  -L/opt/Qtopia/lib -L/opt/Qtopia/lib -lm -lqpe -lqtopia -lqte-mt -lpthread
/usr/bin/ld: ne peut trouver -lqte-mt
collect2: ld a retourné 1 code d'état d'exécution
make: *** [gpus] Erreur 1
pc3c15:/v3#

-> it find qthread.h but he's got a problem in the link edition

Have you got a suggestion for me ?

thanks,
Matthieu

lpotter

  • Sr. Member
  • ****
  • Posts: 450
    • View Profile
    • http://qtopia.net
Qtpoia SDK problems
« Reply #28 on: April 02, 2005, 06:43:27 pm »
Are you using qt/e3?
Qtopia only works with qt embedded 2.3.x, latest version of which is 2.3.10
It won't work with qt embedded 3

Quote
Hi,

-> it find qthread.h but he's got a problem in the link edition

Have you got a suggestion for me ?

thanks,
Matthieu
[div align=\"right\"][a href=\"index.php?act=findpost&pid=73272\"][{POST_SNAPBACK}][/a][/div]
« Last Edit: April 02, 2005, 06:47:18 pm by lpotter »
Software Engineer, Systems Group, MES, Trolltech
irc.freenode.net #qtopia
http://qtopia.net

Matthieu

  • Newbie
  • *
  • Posts: 13
    • View Profile
Qtpoia SDK problems
« Reply #29 on: April 03, 2005, 03:40:07 am »
No, I'm using the version 2.3.7 of qt embedded.