Menu

#4 Doesn't compile in GCC - Ubuntu 12.10

v1.0 (example)
closed-fixed
nobody
None
5
2013-05-10
2013-01-31
No

GCC Version 4:4.72-1ubuntu2 (as reported by output from 'dpkg -l | grep gcc')

Arch: x86_64/ (actual arch: amd64)

I tried to see what's up, doesn't compile.

Error output:

gcc -DNSF_PLAYER -ggdb -Isrc -Isrc/linux -Isrc/sndhrdw -Isrc/machine -Isrc/cpu/nes6502 -Insfobj -I/usr/local/include/ -DNES6502_MEM_ACCESS_CTRL -lm -o nsfobj/nosefart nsfobj/build/log.o nsfobj/build/memguard.o nsfobj/build/cpu/nes6502/nes6502.o nsfobj/build/cpu/nes6502/dis6502.o nsfobj/build/machine/nsf.o nsfobj/build/sndhrdw/nes_apu.o nsfobj/build/sndhrdw/vrcvisnd.o nsfobj/build/sndhrdw/fmopl.o nsfobj/build/sndhrdw/vrc7_snd.o nsfobj/build/sndhrdw/mmc5_snd.o nsfobj/build/sndhrdw/fds_snd.o nsfobj/build/linux/main_linux.o nsfobj/build/nsfinfo.o nsfobj/config.h
nsfobj/build/sndhrdw/fmopl.o: In function `OPLOpenTable':
/home/khavens/Gaming/NES/nosefart-2.8-mls/src/sndhrdw/fmopl.c:645: undefined reference to `sin'
/home/khavens/Gaming/NES/nosefart-2.8-mls/src/sndhrdw/fmopl.c:646: undefined reference to `log10'
/home/khavens/Gaming/NES/nosefart-2.8-mls/src/sndhrdw/fmopl.c:677: undefined reference to `sin'
/home/khavens/Gaming/NES/nosefart-2.8-mls/src/sndhrdw/fmopl.c:685: undefined reference to `sin'
collect2: error: ld returned 1 exit status
make: *** [nsfobj/nosefart] Error 1

Discussion

  • Matthew Strait

    Matthew Strait - 2013-01-31

    I can't duplicate this, but I am using a different GCC, version 4.4.3-4ubuntu5.1. Looking at the code, though, it's hard to see a problem, unless -lm for some reason isn't good enough to include the math libraries with GCC 4.72.

     
  • Gall

    Gall - 2013-03-07

    I've replicated this problem in gcc 4:4.6.3-1ubuntu5. It appears to be a gcc formatting issue. the `-lm` flag now has to come after the object name. I changed line 110 in the Makefile to `$(CC) $(NSFINFO_CFLAGS) -o $@ $^ $(LDFLAGS)` and it compiled successfully.

     
  • Matthew Strait

    Matthew Strait - 2013-05-10
    • status: open --> closed-fixed
    • Group: --> v1.0 (example)
     

Log in to post a comment.