Adding QtCore Library in blackberry 10 sdk

可紊 提交于 2019-12-06 12:04:35

You can understand what is going wrong if you look closely at the error message:

/target_10_0_9_1673/qnx6/usr/include/qt4/QtCore/qatomic.h:45:28:
fatal error: QtCore/qglobal.h: No such file or directory

The error isn't in your inclusion of QtCore, but is occurring inside QtCore/qatomic.h, on line 45 (you can find this file in the [YOUR BBNDK DIRECTORY]/target_10_0_9_1673/qnx6/usr/include/qt4/QtCore/qatomic.h):

#include <QtCore/qglobal.h>

qatomic.h is already in the QtCore directory, and you'll find a qglobal.h directory there as well. So what this means is that qatomic.h expects the parent directory to be on the include path, so that including <QtCore/qglobal.h> will work.

So you just need to add [YOUR BBNDK DIRECTORY]/target_10_0_9_1673/qnx6/usr/include/qt4 to your include directories.

Do it like this:

  1. Right click over your project in Project Explorer and choose Properties
  2. Expand the tree to C/C++ General / Paths and Symbols
  3. Change the Configuration in the Paths and Symbols frame to [All configurations]
  4. Click the Includes tag and select GNU C in the Languages list (or do this for every language).
  5. Click Add... and type ${QNX_TARGET}/usr/include/qt4 and press OK
  6. Click Add... and type ${QNX_TARGET}/usr/include/qt4/QtCore and press OK

Now your include of #include <QtCore> should work.

Next up: linking errors ;-)

It sounds like your BB10 NDK did not get installed properly, or your project wasn't set up properly. If you expand your project and the Includes you should see (along with others):

<NDK_INSTALL_LOCATION>/target_<VERSION>/qnx6/usr/include/qt4/QtCore
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!