stefanbylund / zxnext_bmp_tools

Spectrum Next BMP tools
MIT License
26 stars 3 forks source link

nextbmp build error with gcc 13.2.0 #3

Closed danboid closed 3 months ago

danboid commented 3 months ago
~/src/zxnext_bmp_tools$ gcc -O2 -Wall -lm -o nextbmp nextbmp.c
/usr/bin/ld: /tmp/ccxSvVXV.o: in function `c8_to_c3':
nextbmp.c:(.text+0x1ba): undefined reference to `round'
/usr/bin/ld: /tmp/ccxSvVXV.o: in function `main':
nextbmp.c:(.text.startup+0x3b0): undefined reference to `round'
/usr/bin/ld: nextbmp.c:(.text.startup+0x3cf): undefined reference to `round'
/usr/bin/ld: nextbmp.c:(.text.startup+0x3ec): undefined reference to `round'
/usr/bin/ld: nextbmp.c:(.text.startup+0x7f2): undefined reference to `round'
/usr/bin/ld: /tmp/ccxSvVXV.o:nextbmp.c:(.text.startup+0x840): more undefined references to `round' follow
collect2: error: ld returned 1 exit status
derekfountain commented 3 months ago

The math library link flag needs to go at the end of the line:

gcc -O2 -Wall -o nextbmp nextbmp.c -lm

So this is actually a documentation error. :)

danboid commented 3 months ago

That's fixed it.

Thanks Derek!

stefanbylund commented 3 months ago

Thanks Derek for pointing out the documentation issue, it has been fixed now.