![]() |
|
#1
|
|||
|
|||
Beginner's Qt/embedded compiling problem******Hello, all. When I try to make the Qt embedded examples, most of the "makes" fail with numerous errors. The only two examples I have made successfully are buttongroups and popup.
******I am trying to develop on a TS-7300 ARM cpu running kernel 2.4.26-ts11. I configured: ./configure -qconfig small. Everything "made" successfully until the first example was compiled. ******Here are the first 10 errors from the make of “checklists”: Code:
****** excerpt from checklists.cpp: CPP / C++ / C Code:
****** excerpt from checklists.h: CPP / C++ / C Code:
****** this is what make is attempting to do: Code:
root@ts7000:examples# ll /usr/bin/g++ lrwxrwxrwx 1 root root 7 Sep 14 19:20 /usr/bin/g++ -> g++-3.3* ****** I am using Qt/embedded 3.3.4 and this version of g++: root@ts7000:examples# g++ -dumpversion 3.3.5 ****** qlistview.h exists in two places ( but the first links to the second): root@ts7000:checklists# find / -name qlistview.h /usr/local/qt-embedded-free-3.3.4/src/widgets/qlistview.h /usr/local/qt-embedded-free-3.3.4/include/qlistview.h ****** this is the output of “env” HOME=/root LOGNAME=root _=/usr/bin/env root@ts7000:checklists# env | more HZ=100 SHELL=/bin/bash TERM=vt100 HUSHLOGIN=FALSE QTDIR=/usr/local/qt-embedded-free-3.3.4 OLDPWD=/usr/local/qt-embedded-free-3.3.4/examples USER=root LD_LIBRARY_PATH=/usr/local/qt-embedded-free-3.3.4/lib QTDIR2=/usr/local/qt-embedded-free-3.3.4 MAIL=/var/mail/root PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/qt-embedded-free-3 .3.4/bin PWD=/usr/local/qt-embedded-free-3.3.4/examples/checklists PS1=\u@\h:\W# SHLVL=1 HOME=/root LOGNAME=root _=/usr/bin/env ******Thanks in advance for any help - I'll gladly take embarassment over hopelessness. Last edited by LuciWiz : 16-Sep-2009 at 18:27.
Reason: Please insert your C++ code between [cpp] & [/cpp] tags
|
|||
|
#2
|
||||
|
||||
Re: Beginner's Qt/embedded compiling problemI use Qt extensively. You appear to be having an issue with your understanding of how Qt does its business.
You will want to create a .pro file for your Qt projects. Start by taking an example Qt project file and using it. Once you have a .pro file for your project, you will want to execute qmake on it. The qmake executable will create a Makefile for your project, with which you can use gmake (usually aliased or named make on most Linux-based systems) to compile and link your executable. I'd recommend that you start with a very simple project that does nothing more than instantiates a QMessageBox with some "Hello World" type text in it. Once you can successfully build and execute it on your x86-based machine, then you may want to consider what efforts it takes for you to deploy to your embedded target. Now, there are a few nuances that you *must* understand in order to effectively use Qt. You must have built the Qt libraries for your target execution environment. This is an imperative. You can not expect x86 compilers to produce object code that will run on an ARM. What you need to do is to ensure that you have a working cross compilation environment configured for your target and that it is in your PATH environment variable. Once you have a target compilation environment and can write a simple C++-based hello world app and execute it on your target platform, you are ready to build Qt for the target. If there is already an existing Qt "port" for your target, you are well ahead of the game. Otherwise, you'll want to create your own <qt_install_dir>/mkspecs/qws directory and related files. I recommend that you copy an existing architecture directory that is fairly similar to your own. However, linux-arm-g++ may be sufficient. Read the qmake.conf file inside of that directory to see if it meets the needs of your cross compiler arguments. If it doesn't, I recommend that you create a copy of the similar one and rename the directory to something that denotes your architecture and then make the modifications needed to qmake.conf. Once you have qmake.conf right for your architecture, you're ready to start. Building Qt is a three phase endeavor. Actually, there are several phases, but there are probably only three that are of the most importance to you. 1: configure 2: make (qmake and other binary tools that run on the x86) 3: make for your target architecture If you have not already built Qt for your x86, please do that first. Start by freshly extracting the tarball to a new directory location. Enter the directory and execute the configure script as follows: $ ./configure -prefix /usr/local/qt-emb-x86-3.3.4 I recommend using the defaults for now. When you gain more understanding, you will be ready to use more "features" of configure to custom tailor your Qt builds. When configure completes, run make (use -j8 if you have a fast dual core machine) and then (as root) make install When you have a complete installation, modify your QTDIR environment variable to point to /usr/local/qt-emb-x86-3.3.4 and then add $QTDIR/bin to your $PATH. At that point, you are ready to consider cross configuring Qt. However, I'd probably recommend that you wait until after you have been able to write your own Qt-based hello app and can build and execute it on x86. Building a new Qt-based app is really just the following steps: 1: create a new project directory 2: create a new .pro project file 3: create your source files 4: add your source files and related project details to your .pro file 5: run qmake 6: run make 7: debug/test your app Get so where you know and understand each of these steps as a bare minimum. If you were able to do these steps, we wouldn't be seeing the junk coming from your screen. You need to have complete confidence in these steps before you're ready to do any work on an embedded target platform. It gets harder, not easier when you move from something with which many people feel confident (their own computers) to "devices." Those devices are complete little, self-contained worlds of their own. Every step that you take that gets you closer to them gets a bit more challenging and is a learning curve that you'll have to complete before you're ready for the next step. Read and use the Qt reference documentation. It is very substantial, but tends to assume more knowledge as you get more into the embedded side of things. MxB |
Recent GIDBlog
Vista ?Widgets? on Windows XP by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| cout problem on compiling | Golmal | C++ Forum | 1 | 17-Jan-2008 06:59 |
| Problem compiling MFC program | shvalb | MS Visual C++ / MFC Forum | 1 | 21-Sep-2006 20:14 |
| Problem compiling a program, my first vector. | george89 | C++ Forum | 2 | 26-Jun-2006 21:10 |
| Problem compiling GMP code | Bruno Couto | C Programming Language | 2 | 07-Oct-2005 09:40 |
| Compiling problem, please help. | os008 | C++ Forum | 6 | 06-Feb-2005 09:02 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The