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
Developer
Posts: 132
Registered: ‎01-24-2013
My Device: blackberry z10
My Carrier: none
Accepted Solution

add "bb/cascades" to include path

Hello.

 

Id like to be able to write includes as

#include <Container>

 

 

instead of

#include <bb/cascades/Container>

 analogous to the QT includes.

 

I cant seem to get this to work despite several attempts such as editing INCLUDEPATH in my pro file

Project-Properties-C++General-Paths and Symbols-Gnu C (theres no C++ strangely!).

 

Anybody know how to get this to work?

 

Thanks in Advance

Highlighted
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: add "bb/cascades" to include path

Hi,

 

Base path to SDK is QNX_DIR. Add this line to .pro file:

 

INCLUDEPATH += $${QNX_DIR}/usr/include/bb $${QNX_DIR}/usr/include/bb/cascades

 

But I recommend against doing this. You'll have to use corresponding namespaces anyway and it's easier to deduce them from full pathnames. Also it increases the risk of name clashes.

 


Andrey Fidrya, @zmeyc on twitter
Developer
Developer
Posts: 132
Registered: ‎01-24-2013
My Device: blackberry z10
My Carrier: none

Re: add "bb/cascades" to include path

Thanks for the helpful reply.

That did the trick.

Where did you find QNX_DIR documented?

 

I had edited the pro file but using TARGET_DIR, which didnt work

(I had found it documented here)

 

If I output the values in my pro file as 

 

message(QNX_DIR = $$QNX_DIR)
message(QNX_TARGET = $$QNX_TARGET)
message(QNX_HOST = $$QNX_HOST)

 

I get something like this is the console:

 

Project MESSAGE: QNX_TARGET =
Project MESSAGE: QNX_HOST =
Project MESSAGE: QNX_DIR = /home/dev/blackberry/bbndk/target_10_0_10_263/qnx6

 

Strange that QNX_TARGET and QNX_DIR are empty. Any idea why?

 

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: add "bb/cascades" to include path

[ Edited ]

It's undocumented, I've checked what NDK uses internally in mkspec:

 

target_10_0_10_261/qnx6/usr/share/qt4/mkspecs/common/qcc-base-qnx.conf:QNX_DIR = $$(QNX_TARGET)
target_10_0_10_261/qnx6/usr/share/qt4/mkspecs/common/qcc-base-qnx.conf:QMAKE_INCDIR = $${QNX_DIR}/usr/include $${QNX_DIR}/usr/include/freetype2

 

QNX_TARGET & QNX_HOST are environment variables. I've just found that they are resolved properly when in brackets.  So $$(QNX_TARGET) can be used as well:

 

message(QNX_DIR = $$QNX_DIR)
message(QNX_TARGET = $$(QNX_TARGET))
message(QNX_HOST = $$(QNX_HOST))

 

QNX_DIR    = /Applications/bbndk/target_10_0_9_2372/qnx6
QNX_TARGET = /Applications/bbndk/target_10_0_9_2372/qnx6
QNX_HOST   = /Applications/bbndk/host_10_0_9_534/darwin/x86

 

 


Andrey Fidrya, @zmeyc on twitter
Developer
Developer
Posts: 132
Registered: ‎01-24-2013
My Device: blackberry z10
My Carrier: none

Re: add "bb/cascades" to include path

Thanks very much!