Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
xsacha
Posts: 90
Registered: ‎10-30-2011
My Device: Blackberry Playbook

Re: libQtMobilitySimulator not available

[ Edited ]

The library that it uses is: libdeclarative_sensors.so

Full path:

${QNX_TARGET}/x86/usr/lib/qt4/imports/QtMobility/sensors/libdeclarative_sensors.so

 

It should add this automatically for you, based on your config.

 

The includes and the libraries are the same as the ARM build. Nothing changes. You don't need to define anything related to the simulator.

Although, I just realised you probably don't have the ARM device.

Developer
djogon
Posts: 93
Registered: ‎10-29-2012
My Device: Z10

Re: libQtMobilitySimulator not available

As I mentioned in my original post. I do have the ARM device and the app builds and works fine on it. The problem is building for the simulator. One is ARM processor, another is x86 so the libraries are different.

My original report simply states that QtMobilitySimulator is reported missing by the build process. The build process automatically and correctly tried to include the correct library (like every other library btw. since these are not binary compatible). The QtMobilitySimulator library is missing and the linker cannot link the app.

 

I am using a Qt .pro style file to specify the features and libraries.

 

Developer
xsacha
Posts: 90
Registered: ‎10-30-2011
My Device: Blackberry Playbook

Re: libQtMobilitySimulator not available

[ Edited ]

As I mentioned in my last post QtMobilitySimulator is *not* what you want. There is no QtMobilitySimulator and never will be because that's for an unrelated simulator.

 

You want the same library and includes as the ARM build. The directory is automatically changed according to ${CPUVARDIR} (x86 or armle-v7).

 

Again, this is the library you want:

${QNX_TARGET}/x86/usr/lib/qt4/imports/QtMobility/sensors/libdeclarative_sensors.so

 

This is the ARM library:

${QNX_TARGET}/armle-v7/usr/lib/qt4/imports/QtMobility/sensors/libdeclarative_sensors.so

 

They are both:

${QNX_TARGET}/${CPUVARDIR}/usr/lib/qt4/imports/QtMobility/sensors/libdeclarative_sensors.so

 

If you want to see what libraries are available in the NDK you can look through ${QNX_TAGET}/${CPUVARDIR}

Developer
djogon
Posts: 93
Registered: ‎10-29-2012
My Device: Z10

Re: libQtMobilitySimulator not available

I understand that - I think we are fundametally not talking about the same issue.

To explain it better - please download the example accelerator game app from BB's github here

 

https://github.com/blackberry/Cascades-Samples/tree/master/SensorsAccelGame

 

Can you make that game run in your simulator? If so - how?

 

 

Developer
xsacha
Posts: 90
Registered: ‎10-30-2011
My Device: Blackberry Playbook

Re: libQtMobilitySimulator not available

[ Edited ]

Yes, that project is misconfigured. It should not be adding mobility.

 

 

In your .pro file:

Remove: CONFIG += mobility

Add: LIBS += -lQtSensors

 

The linker line should be identical for ARM and x86. It appears like this:

... -lQtSensors -lbb -lbbcascades -lQtDeclarative -lQtScript -lQtSvg -lQtSql -lQtXmlPatterns -lQtXml -lQtGui -lQtNetwork -lQtCore 

Developer
djogon
Posts: 93
Registered: ‎10-29-2012
My Device: Z10

Re: libQtMobilitySimulator not available

That's exactly it! Thank you. I did not know that QtSensors was supported directly - this now makes perfect sense.

 

 

Developer
djogon
Posts: 93
Registered: ‎10-29-2012
My Device: Z10

Re: libQtMobilitySimulator not available

Spoke too soon. There's a real bug going on here.

 

If I remove the "mobility" from the CONFIG in the .pro file and perform full "Clean" before the build. The build fails with the following error

 

/Applications/bbndk/target_10_0_9_386/qnx6/usr/include/qt4/QtSensors/qsensor.h:45:29: fatal error: qmobilityglobal.h: No such file or directory

 If I then remove the "mobility" from the CONFIG variable and build again. It builds and runs fine in the simulator. As long as I do not perform full clean, then build - everything is fine. If I clean it - I have to add mobility first, build with the above error, then remove mobility and build again for it to work.

 

So this is a workaround, but seems like a real bug. I will file it with the BB team.

 

Developer
xsacha
Posts: 90
Registered: ‎10-30-2011
My Device: Blackberry Playbook

Re: libQtMobilitySimulator not available

[ Edited ]

Sorry, I forgot, you'll also want to add:

    INCLUDEPATH += ${QNX_TARGET}/usr/include/qt4/QtMobility

since we removed the mobility CONFIG (which was incorrecly setting QtMobilitySimulator).

 

It sets this on line 54 of ~/bbndk/target_10_0_9_386/qnx6/usr/share/qt4/mkspecs/features/mobility.prf

Just a naming issue because there are two 'simulators'. If you remove that line, the project should build unmodified.

Developer
djogon
Posts: 93
Registered: ‎10-29-2012
My Device: Z10

Re: libQtMobilitySimulator not available

Yes - that fixed it. I filed a bug anyway since this should obviously work with mobility in CONFIG as well.

 

Thank you for your help.