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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 22
Registered: ‎02-02-2012
My Device: none
My Carrier: none

'Conflicting types' issue in porting Qt application

[ Edited ]

I think it's simple problem. I am porting my Qt application, where I have following plain C methods:

 

uint64_t rand64_r(struct drand48_data* rnd_buf) {
    uint64_t buff = 0;
    lrand48_r(rnd_buf, &buff);
    uint64_t res = buff << 32;
    lrand48_r(rnd_buf, &buff);
    res = res + buff;
    return res;
}

uint32_t rand32_r(struct drand48_data* rnd_buf) {
    long buff = 0;
    lrand48_r(rnd_buf, &buff);
    return buff;
}

 But when I'm trying to build it NDK I get following:

warning: 'struct drand48_data' declared inside parameter list
error: conflicting types for 'rand64_r'
warning: 'struct drand48_data' declared inside parameter list
error: conflicting types for 'rand32_r'

Could anybody point me what I'm doing wrong?

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: 'Conflicting types' issue in porting Qt application

I tried to reproduce this compiler warning but haven't succeeded.

As I understand it, this warning is for structures actually declared in the parameter list, which is not what you're showing in your code snippet.

 

Are you still having an issue?

If so, can you show the relevant include files, and any other declarations of your routines?

Developer
Posts: 62
Registered: ‎03-31-2012
My Device: Playbook
My Carrier: None

Re: 'Conflicting types' issue in porting Qt application

Are you missing a include for drand48_data? It complains about it is not declared.

Highlighted
Contributor
Posts: 22
Registered: ‎02-02-2012
My Device: none
My Carrier: none

Re: 'Conflicting types' issue in porting Qt application

I've found out that stdlib.h in NDK does not contain the lrand48_r definition, so I replaced it with lrand48 and removed drand48_data from parameters.