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
mmd12
Posts: 117
Registered: ‎03-13-2012
My Device: Playbook, Dev Alpha C, Q10, Z10
My Carrier: T-Mobile

Error Unable to resolve path variable "QNX_TARGET"

I've been going through the tutorials and samples.  For the most part I've been having success.

 

I'm getting the following error when I try to load and run some of the samples through the IDE.

 

Packaging failed:1
Error: Unable to resolve path variable "QNX_TARGET"

 

It's occuring on some but not all of the the ones I've done, even ones that I had success with in the past.

 

Any ideas on what it means and how to resolve?

 

Thanks.

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Error Unable to resolve path variable "QNX_TARGET"

Depending on your platform, there NDK has a bbndk-env.sh file or bbndk-env.bat file which you need to execute (or, in Linux or Mac, "source"). That defines that environment variable and others, and you should do this each time you open a new console window, or arrange to have it executed automatically for each new window. (In Linux, for example, you can put "source pathtondk/bbndk-env.sh" in your .bashrc file, and similar facilities exist on Windows.)

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
mmd12
Posts: 117
Registered: ‎03-13-2012
My Device: Playbook, Dev Alpha C, Q10, Z10
My Carrier: T-Mobile

Re: Error Unable to resolve path variable "QNX_TARGET"

Thanks Peter.

 

I located the bbndk-env.bat and ran it.  I'm still getting the same error.

 

Using Win7

QNX® Momentics IDE for BlackBerry® Native SDK for Tablet OS

 Version: 2.0.0

 

Any other thoughts?

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Error Unable to resolve path variable "QNX_TARGET"

Ah, I missed that you were using the IDE. I gave instructions for command line use...

How are you launching it?

The same folder where you found the bbndk-env script should have one called just bbndk.bat. In mine, that clearly sets QNX_TARGET before launching Eclipse.

My Start Menu entry, however, does not execute that batch file, but runs qde.exe directly, and I see no sign of a system-wide QNX_TARGET setting. Maybe it's supposed to have that defined internally somewhere?

Try uninstalling, reinstalling, and possibly a reboot afterwards? Sorry, no other ideas are coming to me.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
falo
Posts: 97
Registered: ‎05-12-2009
My Device: PlayBook
My Carrier: 3

Re: Error Unable to resolve path variable "QNX_TARGET"

I think peter's spot on with the bbndk.bat choice as I had the same thing. The default shortcut setup by the installer points directly at the executable, which is rather annoying. Switch your shortcuts to the batch file and all should be good (I assume it sets those variables just for that session).

For anyone with the same problem on OSX, there's a similar setenv shell script in the install directory for the ndk. Tweaking this a bit (changing all the calls to use "launchctl setenv") and adding it to a .bashrc file for my profile got everything working nicely.
-------
You can find me (sporadically) writing and developing at http://floor4.co.uk and gaming at http://uk-tf.co.uk
My Apps: Flip!
Please use plain text.
Developer
mmd12
Posts: 117
Registered: ‎03-13-2012
My Device: Playbook, Dev Alpha C, Q10, Z10
My Carrier: T-Mobile

Re: Error Unable to resolve path variable "QNX_TARGET"

Thanks for the reply Peter.

 

I'll look into your suggestion when I'm back at the computer.

 

Funny thing though, is it works on some apps but not others.  You would think it would fail on all.  Just to confirm, I imported another sample program, built it and ran it without any problems.

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Error Unable to resolve path variable "QNX_TARGET"

Okay, maybe you guys have somehow managed to mess up the IDE settings.

 

Look in the "bad' project under Properties -> C/C++ Build -> Environment.  You should see about 10-12 environment variables listed there, including QNX_TARGET.  They all have "BUILD_SYSTEM" in the Origin column (whatever that is).

 

Probably you'll see a difference between the working and non-working projects here. I have no idea how they could get munged, but it seems likely that mine is working fine even though there's no system-wide environment variables set for this simply because they're defined here internally.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
mmd12
Posts: 117
Registered: ‎03-13-2012
My Device: Playbook, Dev Alpha C, Q10, Z10
My Carrier: T-Mobile

Re: Error Unable to resolve path variable "QNX_TARGET"

I tried running bbndk.bat by itself, which sets variables and then launches the exe.  No luck.

 

I also looked at the properties > C/C++ build > environment.  All variables, and values are the same between two samples (one that works, the other that gives me the error) other than the path to the particular programs source files.

 

Just to be specific GoodCitizen works,  OpenGLWindow does not.  I haven't modified any code.  Simply imported, build and run as.

 

I'm puzzled.

 

Please use plain text.
New Member
jeqs
Posts: 2
Registered: ‎06-18-2012
My Device: Playbook
My Carrier: NA

Re: Error Unable to resolve path variable "QNX_TARGET"

Please use plain text.
New Member
jeqs
Posts: 2
Registered: ‎06-18-2012
My Device: Playbook
My Carrier: NA

Re: Error Unable to resolve path variable "QNX_TARGET"

Run IDE from \bbndk-2.0.0\bbndk.bat, this register all nessessary environment variables

Please use plain text.