Reply
Thread Tools
Posts: 19 | Thanked: 7 times | Joined on Jan 2010 @ dallas, tx usa
#1
Hello all,

After much fiddling I finally got a working ESBox install. I am working on a small Qt app and have managed to get up and running fairly quickly. However, I've come across something totally baffling..

My app is trying to split some QString objects, and extract key-value pairs from the result QStringList(s). This all works fine, however, when I try to use a QHash I get very strange undefined reference errors that have nothing to do with QHash, or any of my code.

For example this works:

Code:
void Foo::foo( const QString& params )
{
    QStringList lst = params.split('\r');

    //do some stuff

    return;
}
and this does NOT WORK:
Code:
void Foo::foo( const QString& params )
{
    QStringList lst = params.split('\r');
    QHash<QString, QString> dict;

    //do some stuff

    return;
}
That's it! all I have to do is add a single declaration of this hash, and I get something like:

/home/user/build/helloworld: undefined symbol: _ZN7QLayout14addChildLayoutEPS�*��N11QFormLayout7s etItemEiNS_8ItemRoleEP11QLayoutItem


What is this all about? Has anyone seen this before? My QMake project is setup all right (I have experience with Qt on win32, so I know the basics of the API and make process..).

Has anyone else seen this?
 
gnuton's Avatar
Posts: 18 | Thanked: 12 times | Joined on Nov 2007 @ Taranto, ITALY
#2
Hi,
I can't see any correlation between QHash and this problem. From the error message you posted I understand that linker is complaining about resolving symbol for QLayout::addChildLayout

QHash is part of QtCore and QLayout is part of QtGUI. Usually linker complain about unresolved symbols when the library (libQtGUI) is missing or symbol is not in the library.

Check to have libQtGUI installed into your device and that Qt version you use in SB it's the same into the device.
 

The Following 2 Users Say Thank You to gnuton For This Useful Post:
Posts: 19 | Thanked: 7 times | Joined on Jan 2010 @ dallas, tx usa
#3
That's what has me baffled. That simgle delcaration will break the app, but has nothing at all to do with the errr. What is even more interesting is that this ONLY happens in debug. I can run the app fine as a release build.

I have been using ESBox on Ubuntu, my device has PR1.1, and my scratchbox install is complete. I am at a loss...
 
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#4
As the old saying goes, when in doubt, qmake. Make sure you clean stuff first, check your .pro and do a qmake. Macro directives can also play nasty tricks on you.
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 
Posts: 19 | Thanked: 7 times | Joined on Jan 2010 @ dallas, tx usa
#5
Well, I got things working again. My rain dance was as follows:

Remove all Qt libs from the device
Update Ubuntu install (latest karmic updates)
run qmake from scratchbox terminal (rather than letting ESBox do this)
make clean
reinstall Qt on the device

Now things work. I think I may have had a version conflict between the Qt on the device and the version in scratchbox (mix of 4.5 and 4.6 beta maybe..?)
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:44.