"Undefined symbol: float" error when compiling for ti83p

TI-82, TI-83 (plus, silver..), TI-84, TI-85 and TI-86
Post Reply
asdfezxcas
New member
Posts: 1
Joined: Wed Jan 08, 2025 8:18 pm

"Undefined symbol: float" error when compiling for ti83p

Post by asdfezxcas »

Evening,

I've been brushing up on C and trying to write some programs for the TI84 plus. I've been able to get some basic programs working, but right now I'm having trouble compiling the following program. I'm not sure if the issue is in something I'm doing, an issue with my installation of the compiler, or the compiler itself. I'm on Ubuntu, and I'm using version 23064-e05ec48f33-20250103 downloaded through snap.

This is the code in question:

Code: Select all

#pragma string name CIRIDC
#include <stdio.h>

//prototypes
void paraRes();
void curDiv();
void voltDiv();

//selects program to run
int main(){
    char choice;

    printf("1.ParaRes\n2.CurDiv\n3.VoltDiv\n");
    choice = getkey();
    switch(choice)
        {
        case'1': paraRes();
        break;
        case'2': curDiv();
        break;
        case'3': voltDiv();
        break;
    }

    return 0;
}

//parallel resistor (or parallel inductor, OR series capactior)
void paraRes(){
    float denom;
    float temp;
    float equiv;
    int count;

    printf("Parallel Resistors\nCount:");
    scanf("%d", &count);

    for (denom = 0; count > 0; count-- )
    {
        printf("R:");
        scanf("%f", &temp);
        denom = denom + (1/temp);
    }

    equiv = (1/denom);

    printf("Equiv:\n%f",equiv);

}

//current divider over parallel resistors
void curDiv(){
    int count;

    printf("Current Divider\nCount:");
    scanf("%d", &count);
}

//voltage divider over series resistors
void voltDiv(){
    int count;

    printf("Voltage Divider\nCount:");
    scanf("%d", &count);
}
This is the command I'm using to compile the code:

Code: Select all

z88dk.zcc +ti83p -o build/code.bin -create-app ciridc.c -subtype=asm
This is the error I'm getting:

Code: Select all

ciridc.c::paraRes::0::3:29: error: undefined symbol: dswap
  ^---- dswap
ciridc.c::paraRes::0::3:29: error: undefined symbol: ddiv
  ^---- ddiv
ciridc.c::paraRes::0::3:29: error: undefined symbol: dadd
  ^---- dadd
ciridc.c::paraRes::0::3:29: error: undefined symbol: dswap
  ^---- dswap
ciridc.c::paraRes::0::3:29: error: undefined symbol: ddiv
  ^---- ddiv
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/c/sccz80/atof.asm:15: error: undefined symbol: mlib2d
  ^---- mlib2d
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__dtoa__.asm:48: error: undefined symbol: asm_fpclassify
  ^---- asm_fpclassify
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__dtoa__.asm:73: error: undefined symbol: __dtoa_base10
  ^---- __dtoa_base10
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__dtoa__.asm:106: error: undefined symbol: __dtoa_digits
  ^---- __dtoa_digits
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__dtoa__.asm:140: error: undefined symbol: __dtoa_digits
  ^---- __dtoa_digits
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__dtoa_preamble.asm:54: error: undefined symbol: __dtoa_sgnabs
  ^---- __dtoa_sgnabs
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__dtoa_print.asm:34: error: undefined symbol: __stdio_printf_sign_0
  ^---- __stdio_printf_sign_0
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__dtoe__.asm:47: error: undefined symbol: asm_fpclassify
  ^---- asm_fpclassify
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__dtoe__.asm:72: error: undefined symbol: __dtoa_base10
  ^---- __dtoa_base10
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__dtoe__.asm:97: error: undefined symbol: __dtoa_digits
  ^---- __dtoa_digits
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__dtoe__.asm:105: error: undefined symbol: __dtoa_digits
  ^---- __dtoa_digits
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/asm_strtod.asm:104: error: undefined symbol: asm_dneg
  ^---- asm_dneg
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/asm_strtod.asm:111: error: undefined symbol: asm_dsigdig
  ^---- asm_dsigdig
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/asm_strtod.asm:179: error: undefined symbol: derror_einval_zc
  ^---- derror_einval_zc
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__strtod_dec.asm:26: error: undefined symbol: derror_einval_zc
  ^---- derror_einval_zc
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__strtod_dec.asm:51: error: undefined symbol: derror_znc
  ^---- derror_znc
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__strtod_dec.asm:104: error: undefined symbol: asm_double16u
  ^---- asm_double16u
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__strtod_dec.asm:141: error: undefined symbol: asm_double16u
  ^---- asm_double16u
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__strtod_dec.asm:148: error: undefined symbol: asm_dmul10a
  ^---- asm_dmul10a
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__strtod_dec.asm:149: error: undefined symbol: asm_dadd
  ^---- asm_dadd
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__strtod_dec.asm:289: error: undefined symbol: asm_dmulpow10
  ^---- asm_dmulpow10
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__strtod_dec.asm:300: error: undefined symbol: derror_znc
  ^---- derror_znc
/build/z88dk/parts/part-z88dk/build/libsrc/_DEVELOPMENT/stdlib/z80/__strtod_dec.asm:302: error: undefined symbol: derror_erange_pinfc
  ^---- derror_erange_pinfc
../_DEVELOPMENT/l/sccz80/9-common/f48/fa.asm:12: error: undefined symbol: init_floatpack
  ^---- init_floatpack
../_DEVELOPMENT/l/sccz80/9-common/f48/int2long_u_float.asm:14: error: undefined symbol: float
  ^---- float
I believe it has to do with the floats in the paraRes function. I can get the program to compile with that function's contents dummied out, but of course that's not very useful. Any advice would be much appreciated. Thanks!
User avatar
dom
Well known member
Posts: 2255
Joined: Sun Jul 15, 2007 10:01 pm

Re: "Undefined symbol: float" error when compiling for ti83p

Post by dom »

You need to select a maths library to use: https://github.com/z88dk/z88dk/wiki/Cla ... -Libraries

Try adding -lm to your command line.
Post Reply