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
javoid
Posts: 194
Registered: ‎11-24-2012
My Device: Dev Alpha B, Bold 9700
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

 

 

Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

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

any other errors in console when compiling?

Developer
javoid
Posts: 194
Registered: ‎11-24-2012
My Device: Dev Alpha B, Bold 9700

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;
      }
  }
}

 

 

 

Developer
javoid
Posts: 194
Registered: ‎11-24-2012
My Device: Dev Alpha B, Bold 9700

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?

Developer
javoid
Posts: 194
Registered: ‎11-24-2012
My Device: Dev Alpha B, Bold 9700

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.

Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

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

First try explicitly say

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