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
Posts: 23
Registered: ‎02-13-2013
My Device: Blackberry 10
My Carrier: IDEA

'std::ssize_t' has not been declared error

Hi, 

 

I am porting another application to Blackberry native. And I am getting the errors like, 'std::ssize_t' has not been declared error, 'std::mode_t' has not been declared error. It is shown in a header file, ie, sys/types.h. As I haven't modified this file, I am at a lose here.

 

As suggested in this thread, http://supportforums.blackberry.com/t5/Native-Development/NDK-Errors-with-external-file/td-p/1423619  I tried to compile the application using Managed way and tried to add 'm' to Library Options and '-lm' to Extra Linker options. But its not working. BTW, am I adding it correctly? simply add 'm' to library options?

 

How to do the same with a makefile for cascades app? (ie, adding extra linker options)

 

When I try to comment the specified line in types.h ie, 'using _CSTD size_t; using _CSTD ssize_t; using _CSTD time_t;' it gives me lot of errors like 'string does not name a type'. I've already included <string> and <string.h> and only used 'using namespace std' in c++ files only (not on header files).

 

Can anyone help me?

Highlighted
Retired
Posts: 571
Registered: ‎06-25-2010
My Device: Z10
My Carrier: Vodafone

Re: 'std::ssize_t' has not been declared error

Hi

 

those types should be available without you needing to do anything special. As a test I just created a new Cascades project in Momentics with the File-New-BlackBerry Project function and accepted all defails. I then edited the generated applicationui.cpp file and made it like this:

 

#include <sys/types.h>

using namespace bb::cascades;

ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
        QObject(app)
{

    std::ssize_t a;
    std::mode_t b;

 This builds with no errors.

 

So there must be something wrong with your project set-up.

 

Are you using Momentics or are you building from the command line?

 

Could you post some code or console output to help narrow down the problem please?

 

Thanks

 

Martin

--------------------------------------------------------------------------------------------
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Follow me on Twitter: @mdwrim
Developer
Posts: 23
Registered: ‎02-13-2013
My Device: Blackberry 10
My Carrier: IDEA

Re: 'std::ssize_t' has not been declared error

Hi,

 

its not working.

 

Like you told, I made a new cascade project and added lines,

 

#include <sys/types.h>

 

and 

 

std::ssize_t a;
std::mode_t b; inside ApplicationUI::ApplicationUI(bb::cascades::Application *app)

 

Then it is building properly. But when I add my c++ files, it is showing errror, 'std:;dev_t', 'std::mode_t', and 'std:;ssize_t' is not declared. 

 

The error is shown in the standard header file <sys/types.h> at line numbers 328 and 329. As I cannot modify this file, I am at a loss here.

 

Any other options/