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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Native Development

Reply
Developer
javoid
Posts: 174
Registered: ‎11-24-2012
My Carrier: NA
Accepted Solution

another namespace question? 'CameraSettings' was not declared in this scope

I have a native camera c++ app coded and successfully running.

 

I want to modify the flash mode.  So I add:

 

CameraSettings* cameraSettings = new CameraSettings();
 cameraSettings->setFlashMode(CameraFlashMode::Light);
 camera->applySettings(cameraSettings);

I also add:

#include <bb/cascades/multimedia/CameraSettings>
#include <bb/cascades/multimedia/CameraFlashMode>

 When I build I get the error:

'CameraSettings' was not declared in this scope.

 

Is this a namespace issue or a:

LIBS += ?

...issue?

 

Something else?

 

My current LIBS:

 

 

LIBS += -lcamapi -lscreen

 

 

Please use plain text.
Developer
BGmot
Posts: 961
Registered: ‎11-24-2011
My Carrier: x

Re: another namespace question? 'CameraSettings' was not declared in this scope

any other errors in console when compiling?

Please use plain text.
Developer
javoid
Posts: 174
Registered: ‎11-24-2012
My Carrier: NA

Re: another namespace question? 'CameraSettings' was not declared in this scope

Yes:

 

error: 'CameraSettings' was not declared in this scope

note: suggested alternative:

note: 'bb:cascades:multimedia::CameraSettings'

error: 'cameraettings' was nto declared in this scope

error: expected type-specifier before 'CameraSettings'

error: expected ';' before 'CameraSettings'

 

I also tried:

namespace bb
{
  namespace cascades
  {
      namespace multimedia
      {
         class CameraSettings;
         class CameraFlashMode;
      }
  }
}

 

 

 

Please use plain text.
Developer
javoid
Posts: 174
Registered: ‎11-24-2012
My Carrier: NA

Re: another namespace question? 'CameraSettings' was not declared in this scope

Also tried:

 

#include <bb/cascades/multimedia/Camera>

#include <bb/cascades/multimedia/CameraSettings>

#include <bb/cascades/multimedia/CameraFlashmode>

 

I'm already using:

#include <camera/camera_api.h>

 

Could this be an issue?

Please use plain text.
Developer
javoid
Posts: 174
Registered: ‎11-24-2012
My Carrier: NA

Re: another namespace question? 'CameraSettings' was not declared in this scope

I see what's happening, I'm mixing the c functions with QT.

 

I need to use the settings as shown in this example:

http://supportforums.blackberry.com/t5/Native-Development/Flash-always-on-CAMERA/m-p/1911403/highlig...

 

Thanks for your help.

Please use plain text.
Developer
BGmot
Posts: 961
Registered: ‎11-24-2011
My Carrier: x

Re: another namespace question? 'CameraSettings' was not declared in this scope

First try explicitly say

bb:cascades::multimedia::CameraSettings* cameraSettings = new CameraSettings();

 

Please use plain text.