[comp.sys.amiga] Problem with lattice.

CRONEJP@UREGINA1.BITNET (Jonathan Crone) (03/27/89)

The following code causes  Blink to complain bitterly
with the following errors....

""Undefined symbols ""
_CXV45
_CXS55
_CXM55
_CXV54
_CXD55
_CXA55

the compile comand line is   ""lc -L random ""

this silly program is supposed to
generate 100 random numbers by the addative congruative method,
and then do a chi squared test.

I'm running Lattice 5.0 (I've got the patches, but the semester
has been a bloody blitz...)

the wierd thing is that the Vax using VMS and a Unix system here
compile the code just fine.... (and of course... run it as well)

any ideas would be appreciated...




/* Duh random number program */
/* IE: yet another stupid En330 assignment */
/* This is ugly code, but this is too stupid an assignment to create
good code for... */
#include <stdio.h>
main()
{
int x[102];
float count[11];
int n,i;
float sum=0;

/* Set up the inital parameters */

x[1]=57;
x[2]=34;
x[3]=89;
x[4]=92;
x[5]=16;
n=5;

for (i=6;i++ < 101;)
        { x[i]= (x[(i-1)] + x[(i-n)]) % 100; }
printf ("These are the random numbers \n");
for (i=1;i++ <= 20;)
        {
        printf("%d %d %d %d %d\n",x[i],x[i+20],x[i+40],x[i+60],x[i+80]);
        }
for (i=1 ; i++ <101; )
        {
        count[(x[i]/10))]++;   /* take any digit move decimal to left, and
                                 use that single digit to access count array*/
        }
printf("These are the chi squared values\n");
for(i=0;i<10;i++)
        {
        count[i] = ((count[i]-10)*(count[i]-10))/10;
        sum += count[i];
        printf("%d   %f \n",i,count[i]);
        }
printf("the sum of the chi squared test is %5.2f \n",sum);
}


JpC
--------------------------------------------------------------------
Jonathan P. Crone    CRONEJP@UREGINA1.BITNET      cronejp@mcl.UUCP

Heisenberg might have been here...

DavidS@cup.portal.com (David Kenneth Schreiber) (03/28/89)

In article <8903271336.AA07363@jade.berkeley.edu> CRONEJP@UREGINA1.BITNET
(Jonathan Crone) writes:
> The following code causes  Blink to complain bitterly
> with the following errors....

> ""Undefined symbols ""
> _CXV45
> _CXS55
> _CXM55
> _CXV54
> _CXD55
> _CXA55

> the compile comand line is   ""lc -L random ""

> this silly program is supposed to
> generate 100 random numbers by the addative congruative method,
> and then do a chi squared test.

> I'm running Lattice 5.0 (I've got the patches, but the semester
> has been a bloody blitz...)

> the wierd thing is that the Vax using VMS and a Unix system here
> compile the code just fine.... (and of course... run it as well)

> any ideas would be appreciated...

> /* Duh random number program */
> /* IE: yet another stupid En330 assignment */
> /* This is ugly code, but this is too stupid an assignment to create
> good code for... */
> #include <stdio.h>
> main()
> {
> int x[102];
> float count[11]; <--------
> int n,i;
> float sum=0;     <--------

 ...

> JpC
> --------------------------------------------------------------------
> Jonathan P. Crone    CRONEJP@UREGINA1.BITNET      cronejp@mcl.UUCP
> 
> Heisenberg might have been here...

You need to link with the IEEE math library since you're using floating
point variables.  Try "lc -Lm random" (see p. G16 of the Lattice 5.0
docs).

"Amiga users do it in real time"             David Schreiber
                                         at  DavidS@cup.portal.com

cmcmanis%pepper@Sun.COM (Chuck McManis) (03/29/89)

In article <8903271336.AA07363@jade.berkeley.edu> (Jonathan Crone) writes:
->The following code causes  Blink to complain bitterly
->with the following errors....
->""Undefined symbols ""
->_CXV45
->_CXS55
->_CXM55
->_CXV54
->_CXD55
->_CXA55
->the compile comand line is   ""lc -L random ""

Well, check out OMD sometime (I know it's silly to have to disassemble your
code to find out what these calls refer too) and you will notice that these
are calls to add and divide and mulitply numbers. What kind of numbers? Why
floating point numbers. And we have a whole bunch of floating point options
here on the Amiga. 

--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.
"A most excellent barbarian ... Ghengis Kahn!"

walker@sas.UUCP (Doug Walker) (03/30/89)

In article <8903271336.AA07363@jade.berkeley.edu> CRONEJP@UREGINA1.BITNET (Jonathan Crone) writes:
>The following code causes  Blink to complain bitterly
>with the following errors....

If you are using floating point, you have to link with the math libraries.
Add lcm.lib to your library list.

dan@cbmvax.UUCP (Dan Baker CATS) (04/04/89)

In article <8903271336.AA07363@jade.berkeley.edu> CRONEJP@UREGINA1.BITNET 
(Jonathan Crone) writes:
>The following code causes  Blink to complain bitterly 
>with the following errors....
>
>""Undefined symbols ""
>_CXV45
>_CXS55
>_CXM55
>_CXV54
>_CXD55
>_CXA55
>
[lots of details....]

You need to link with lcm.lib first to get Lattice to
do the math you need for this program.  You also have
an unbalanced paren in line 29.

-- 
 Dan Baker, CATS