Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

Rand( ) in GCC compiler

Rand( ) in GCC compiler

2004-09-07 by mouaaz

Dear all,

I am happy to be a member in this group. That is I am doing my 
research in the field of Embedded Syatems. 

At the moment I am trying to use ARM (LPC2129 v2) to do some 
experiments. I've had a problem with using the function Rand(). I 
think that this function has not been defined in GCC compiler yet. 
If I am right, could anybody have suggestions for me.

Thanks a lot,

Mouaaz

RE: [lpc2000] Rand( ) in GCC compiler

2004-09-07 by Curt Powell

Mouaaz,

Are you calling Rand() or rand()? 

Curt
Show quoted textHide quoted text
-----Original Message-----
From: mouaaz [mailto:mouaaz@...] 
Sent: Tuesday, September 07, 2004 8:50 AM
To: lpc2000@yahoogroups.com
Subject: [lpc2000] Rand( ) in GCC compiler

Dear all,

I am happy to be a member in this group. That is I am doing my research in
the field of Embedded Syatems. 

At the moment I am trying to use ARM (LPC2129 v2) to do some experiments.
I've had a problem with using the function Rand(). I think that this
function has not been defined in GCC compiler yet. 
If I am right, could anybody have suggestions for me.

Thanks a lot,

Mouaaz     



------------------------ Yahoo! Groups Sponsor --------------------~--> Make
a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/dN_tlB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

Re: Rand( ) in GCC compiler

2004-09-07 by mouaaz

Hi Curt,

Thanks for your concern.

What I did finally,
I copied the following statement from the file "stdlib.h":
extern int rand  (void);
and pasted it in the file in which rand() is used, then took out this 
line 
#include "stdlib.h" 
and the code worked.

Do you think that I am right? 

Aslo, I was wondering that there is no 64 bit data type in GCC 
compiler. Any idea?

Thanks very much.
Mouaaz 





--- In lpc2000@yahoogroups.com, "Curt Powell" <curt.powell@s...> 
wrote:
> Mouaaz,
> 
> Are you calling Rand() or rand()? 
> 
> Curt
> 
> -----Original Message-----
> From: mouaaz [mailto:mouaaz@y...] 
> Sent: Tuesday, September 07, 2004 8:50 AM
> To: lpc2000@yahoogroups.com
> Subject: [lpc2000] Rand( ) in GCC compiler
> 
> Dear all,
> 
> I am happy to be a member in this group. That is I am doing my 
research in
> the field of Embedded Syatems. 
> 
> At the moment I am trying to use ARM (LPC2129 v2) to do some 
experiments.
> I've had a problem with using the function Rand(). I think that this
> function has not been defined in GCC compiler yet. 
> If I am right, could anybody have suggestions for me.
> 
> Thanks a lot,
> 
> Mouaaz     
> 
> 
> 
> ------------------------ Yahoo! Groups Sponsor --------------------
~--> Make
> a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
> Now with Pop-Up Blocker. Get it for free!
> http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/dN_tlB/TM
> --------------------------------------------------------------------
~-> 
Show quoted textHide quoted text
> 
>  
> Yahoo! Groups Links

Re: [lpc2000] Re: Rand( ) in GCC compiler

2004-09-07 by Anton Erasmus

On 7 Sep 2004 at 17:25, mouaaz wrote:

> Hi Curt,
> 
> Thanks for your concern.
> 
> What I did finally,
> I copied the following statement from the file "stdlib.h":
> extern int rand  (void);
> and pasted it in the file in which rand() is used, then took out this 
> line 
> #include "stdlib.h" 
> and the code worked.
> 
> Do you think that I am right? 
> 
> Aslo, I was wondering that there is no 64 bit data type in GCC 
> compiler. Any idea?
> 
[Stuff snipped]

Have you tried long long ? e.g.

long long temp;

temp is then a 64bit signed int.

Regards
   Anton Erasmus-- 
A J Erasmus

Re: Rand( ) in GCC compiler

2004-09-08 by mouaaz

Thank you,

Yes I tried long long on the ARM compiler, it did give me 32-bit

Mouaaz 



--- In lpc2000@yahoogroups.com, "Anton Erasmus" <antone@s...> wrote:
> On 7 Sep 2004 at 17:25, mouaaz wrote:
> 
> > Hi Curt,
> > 
> > Thanks for your concern.
> > 
> > What I did finally,
> > I copied the following statement from the file "stdlib.h":
> > extern int rand  (void);
> > and pasted it in the file in which rand() is used, then took out 
this 
Show quoted textHide quoted text
> > line 
> > #include "stdlib.h" 
> > and the code worked.
> > 
> > Do you think that I am right? 
> > 
> > Aslo, I was wondering that there is no 64 bit data type in GCC 
> > compiler. Any idea?
> > 
> [Stuff snipped]
> 
> Have you tried long long ? e.g.
> 
> long long temp;
> 
> temp is then a 64bit signed int.
> 
> Regards
>    Anton Erasmus-- 
> A J Erasmus

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.