bebbo / gcc

Bebbo's gcc-6-branch for m68k-amigaos
GNU General Public License v2.0
33 stars 11 forks source link

float functions not linked with -lm #209

Open arczi84 opened 10 months ago

arczi84 commented 10 months ago

Compile:

#include <iostream>
#include <cmath>

int main() {
    // Sample floating-point number
    float number = 3.75;

    // Rounding the number using rintf
    float roundedNumber = rintf(number);

    // Displaying the result
    std::cout << "Number before rounding: " << number << std::endl;
    std::cout << "Rounded number: " << roundedNumber << std::endl;

    return 0;
}

$m68k-amigaos-g++ -Os -m68020 -noixemul rintf.cpp -o rintf -lm Result:

/opt/amiga/lib/gcc/m68k-amigaos/13.1.1/../../../../m68k-amigaos/bin/ld: /tmp/ccpSvFYp.o: in function `main':
/tmp/ccpSvFYp.o:(.text+0x40): undefined reference to `rintf'

Links only with manually providing /opt/amiga/m68k-amigaos/lib/libm020/libm.a

EDIT: Compiled binary is not executable.

bebbo commented 7 months ago

add -l__m__