![]() ![]() |
Mar 2 2004, 01:48 AM
Post
#16
|
|
|
Group: Members Posts: 4,515 Joined: 25-October 03 From: Bath, UK Member No.: 464 |
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 |
|
|
|
Mar 2 2004, 12:04 PM
Post
#17
|
|
|
Group: Members Posts: 54 Joined: 28-February 04 From: Birmingham, UK Member No.: 2,080 |
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 |
|
|
|
Mar 2 2004, 07:23 PM
Post
#18
|
|
|
Group: Members Posts: 3 Joined: 11-February 04 Member No.: 1,806 |
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! |
|
|
|
Mar 2 2004, 09:18 PM
Post
#19
|
|
|
Group: Members Posts: 33 Joined: 28-February 04 Member No.: 2,078 |
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 |
|
|
|
Mar 3 2004, 02:27 AM
Post
#20
|
|
|
Group: Members Posts: 4,515 Joined: 25-October 03 From: Bath, UK Member No.: 464 |
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 |
|
|
|
Mar 3 2004, 11:20 AM
Post
#21
|
|
|
Group: Members Posts: 54 Joined: 28-February 04 From: Birmingham, UK Member No.: 2,080 |
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.
http://www.oesf.org/downl.../dev-arm-qpe.sh - Mark |
|
|
|
Mar 5 2004, 05:42 PM
Post
#22
|
|
|
Group: Members Posts: 33 Joined: 28-February 04 Member No.: 2,078 |
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 |
|
|
|
Mar 6 2004, 11:57 AM
Post
#23
|
|
|
Group: Members Posts: 54 Joined: 28-February 04 From: Birmingham, UK Member No.: 2,080 |
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 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 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. |
|
|
|
Mar 6 2004, 12:37 PM
Post
#24
|
|
|
Group: Members Posts: 33 Joined: 28-February 04 Member No.: 2,078 |
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 |
|
|
|
Mar 31 2005, 08:48 AM
Post
#25
|
|
|
Group: Members Posts: 13 Joined: 29-March 05 Member No.: 6,733 |
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.
Attached File(s)
|
|
|
|
Mar 31 2005, 08:53 AM
Post
#26
|
|
|
Group: Members Posts: 288 Joined: 8-December 03 From: London, UK Member No.: 1,065 |
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 |
|
|
|
Mar 31 2005, 01:31 PM
Post
#27
|
|
|
Group: Members Posts: 13 Joined: 29-March 05 Member No.: 6,733 |
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. |
|
|
|
Apr 2 2005, 06:23 AM
Post
#28
|
|
|
Group: Members Posts: 13 Joined: 29-March 05 Member No.: 6,733 |
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 |
|
|
|
Apr 2 2005, 03:43 PM
Post
#29
|
|
![]() Group: Members Posts: 451 Joined: 27-November 03 From: Brisbane, Australia Member No.: 1,001 |
|
|
|
|
Apr 2 2005, 11:40 PM
Post
#30
|
|
|
Group: Members Posts: 13 Joined: 29-March 05 Member No.: 6,733 |
No, I'm using the version 2.3.7 of qt embedded.
|
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 24th May 2013 - 05:51 PM |