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
New Contributor
Someone
Posts: 6
Registered: ‎11-18-2011
My Device: Playbook
Accepted Solution

NDK Errors with external file

[ Edited ]

I'm getting no errors in my code, but for some reason I'm getting errors in the file: "unistd.h" which is in "[ndkdir]\target\qnx6\usr\include\". I'm getting 13 of them. The errors are: " 'ssize_t' in namespace 'std' does not name a type", "std::dev_t has not been declared", "std::mode_t has not been declared", and "std::ssize_t has not been declared". The others are repeats (the first one is the one that shows up the most). They're clearly related. Here is one of the lines that produces the first error: "extern _CSTD ssize_t pread64(int __filedes, void *__buff, _CSTD size_t __nbytes, off64_t __offset);". I don't know why it's doing that since I haven't modified the file.

 

Thanks, and sorry about the bad title.

Retired
cdamus
Posts: 45
Registered: ‎10-25-2010
My Device: Bold 9700

Re: NDK Errors with external file

Hi, Someone,

 

In the workspace Preferences dialog, find the "C/C++ -> Code Analysis" preference page and uncheck all of the "Semantic and Syntax" problems.

 

HTH,

 

Christian

New Contributor
Someone
Posts: 6
Registered: ‎11-18-2011
My Device: Playbook

Re: NDK Errors with external file

[ Edited ]

-removed-

 

Nevermind that... that was a bit stupid actually... Somehow I managed to delete one of my files which caused unhelpful errors. Now I'm just getting undefined reference to `strt' errors and things like that. Any ideas regarding that? :s

Retired
cdamus
Posts: 45
Registered: ‎10-25-2010
My Device: Bold 9700

Re: NDK Errors with external file

An executable application must have a main function.  The linker can't produce your binary unless some object file supplies a main.  This would not be related to adding the math library; it's just that adding the math library allowed the linking process to get to the point of trying to generate the final linked binary.

 

BTW, rather than add "-lm" to the Extra Linker Options, you should instead add "m" to the Libraries option.  This tells the IDE explicitly that your application requires libm, which may enable other related tooling features.  With just "-lm", the IDE won't know the meaning of the setting.  (I'm assuming that you have a managed-build project, not a makefile project)

 

Cheers,

 

Christian

New Contributor
Someone
Posts: 6
Registered: ‎11-18-2011
My Device: Playbook

Re: NDK Errors with external file

Wow, thanks. Adding "m" to the libraries option fixed all of my problems. I didn't even notice that option. Thanks a lot.