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
d3v3l0p3r
Posts: 162
Registered: ‎07-19-2012
My Device: Q5, Q10, Z10, Z30, PlayBook
My Carrier: Carrier

BETA 4 - SqlDataAccess busted???

[ Edited ]

Can someone please reproduce the following steps and let me know the outcome?

 

  1. In the Momentics IDE press CTRL + N to create new project
  2. In the Wizard expand "BlackBerry" folder and select "BlackBerry Cascades C++ Project" and hit Next
  3. Put "test_datatest" as a project name and hit Next
  4. Select "Standard empty project" template and hit Finish
  5. Try to compile the newly created project. It should compile just fine.
  6. In the newly created project open src/test_datatest.cpp file
  7. Insert the following code one line above line starting with  "using namespace..."
    #include  <bb/data/SqlDataAccess>
  8. Open test_datatest.pro file and add 
    LIBS += -lbbdata 

    to the end of the file

  9. Compile the project again.

DOES IT COMPILE?

 

I am getting 

 

C:/bbndk/target_10_0_9_1101/qnx6/usr/include/bb/data/SqlDataAccess.hpp:13:17: fatal error: QtSql: No such file or directory

 

and cant get it compiled.

 

Steps 7 and 8 above are as per instructions from the docs page here:

 

https://developer.blackberry.com/cascades/reference/bb__data__sqldataaccess.html

 

So it should work. But it doesn't. What is going on?

 

BTW - this worked just fine in Beta 3 and the machine I am doing this on never had Beta 3 installed prior to installing Beta 4

---
If you find my post helpful please "like" it and "accept as a solution"
Please use plain text.
Developer
Developer
tw_
Posts: 42
Registered: ‎05-17-2012
My Device: Playbook, Dev Alpha A
My Carrier: O2

Re: BETA 4 - SqlDataAccess busted???

[ Edited ]

I had the same problem. It did not compile for me either. 

 

I looked into the QMAKE config files and found that the reason is that in Beta 4 in the new "cascades10" config setting only the Qt Core lib is included by default. All the other Qt libs like QtSql, QtNetwork and so on are not included by default any longer.

 

To fix the problem add a additional "QT +=" line to your .pro file (test_datatest.pro in your case) and add all the Qt libs you need. For example for QtSql add the following QT line:

 

APP_NAME = yourAppName

CONFIG += qt warn_on cascades10

QT += sql
LIBS += -lbbdata

include(config.pri)

 Then do a clean of the project and rebuild it again. It should compile now.

 

Please use plain text.
Developer
Developer
tw_
Posts: 42
Registered: ‎05-17-2012
My Device: Playbook, Dev Alpha A
My Carrier: O2

Re: BETA 4 - SqlDataAccess busted???

After reading the Beta 4 native SDK release notes it appears that the new way to go is to use the new "Add Library Dependency wizard" to add all needed libs to the project. From:

http://developer.blackberry.com/native/beta/download/releasenotes_nativesdk/

 

"The Add Library Dependency wizard allows you to pick a new library to add to your project. You can modify Makefiles and .pro files for non-managed projects."

 

I don't know what is meant by "non-managed projects" here are. (Does it mean there are also "managed projects"?)

 

Anyway when I invoke this wizard by Configure -> Add library -> Standard BB platform lib I can select libbbdata and libQtSql there. If I click Next from there the wizard tells me that: 

 

"Project indexer settings will be updated automatically, but due to the freeform nature of qmake project (.pro) build files, this wizard is unable to update them for you. After the wizard closes, a cheatsheet will open with instructions on how to update your project's .pro file manually."

 

The cheatsheet then tells me I have to add these lines to my .pro file:

 

QT += sql
INCLUDEPATH += ../src ${QNX_TARGET}/usr/include/bb/data ${QNX_TARGET}/usr/include/qt4/QtSql
DEPENDPATH += ../src ${QNX_TARGET}/usr/include/bb/data ${QNX_TARGET}/usr/include/qt4/QtSql
LIBS += -lbbdata

INCLUDEPATH and DEPENDPATH appear to be redudant for me. If I remove them my project compiles anyway. But your mileage may vary.

 

What the wizard is also doing is adding the libs to the .cproject file. In another posting of me here I had problems with autocompletion of Qt classes and suggested to workaround the problem by manually copying the missing lines to .cproject. But I think this problem can be more easily solved by using the Add Library Wizard all the time.

Please use plain text.
Developer
Developer
tw_
Posts: 42
Registered: ‎05-17-2012
My Device: Playbook, Dev Alpha A
My Carrier: O2

Re: BETA 4 - SqlDataAccess busted???

I have to add that using the Library Wizard all the time does not resolve all of the problems I refered to above. Even not in Gold. Some include pathes cannot be added to the .cproject file this way. So the workaround I described here is still required for some include pathes:

http://supportforums.blackberry.com/t5/Cascades-Development/Beta-4-Momentics-IDE-autocompletion-does...

 

Please use plain text.