hcmiya / opuscomment

Utility to edit Ogg Opus tags/output gain - Ogg Opusのタグ及びOutput Gain情報をvorbiscomment(1)と互換のあるインターフェイスで編集するユーティリティ
MIT License
19 stars 4 forks source link

Build failing on debian/devuan #32

Open clort81 opened 3 years ago

clort81 commented 3 years ago

Build fails. the -logg failing to link ogg libraries?

Standard debian / devuan (ceres) build environment: libogg-dev and liboggplay1-dev installed arch aarch64

ldconfig -p |grep ogg
        liboggz.so.2 (libc6,AArch64) => /lib/aarch64-linux-gnu/liboggz.so.2
        liboggz.so (libc6,AArch64) => /lib/aarch64-linux-gnu/liboggz.so
        liboggplay.so.1 (libc6,AArch64) => /lib/aarch64-linux-gnu/liboggplay.so.1
        liboggplay.so (libc6,AArch64) => /lib/aarch64-linux-gnu/liboggplay.so
        libogg.so.0 (libc6,AArch64) => /lib/aarch64-linux-gnu/libogg.so.0
        libogg.so.0 (libc6,hard-float) => /lib/arm-linux-gnueabihf/libogg.so.0
        libogg.so (libc6,AArch64) => /lib/aarch64-linux-gnu/libogg.so
./build.sh release
make: Entering directory '/media/sd/pcbak2/Projects/Audio/opuscomment'
make -C src -r
make[1]: Entering directory '/media/sd/pcbak2/Projects/Audio/opuscomment/src'
c99 -o opuscomment -D_POSIX_C_SOURCE=200809L -DNLS -O2 -march=native -mcpu=native -mtune=native -ffast-math -ftree-vectorize -fno-strict-overflow -funsafe-math-optimizations -DNDEBUG  -logg -lm -lpthread put-tags.o parse-tags.o read.o read-flac.o ocutil.o retrieve-tags.o select-codec.o endianness.o error.o main.o
/usr/bin/ld: main.o: in function `main':
main.c:(.text.startup+0x4fc): undefined reference to `ogg_sync_init'
/usr/bin/ld: main.c:(.text.startup+0x508): undefined reference to `ogg_sync_buffer'
/usr/bin/ld: main.c:(.text.startup+0x55c): undefined reference to `ogg_sync_wrote'
/usr/bin/ld: main.c:(.text.startup+0x570): undefined reference to `ogg_sync_buffer'
/usr/bin/ld: main.c:(.text.startup+0x618): undefined reference to `log10'
/usr/bin/ld: parse-tags.o: in function `parse_tags':
parse-tags.c:(.text+0x1414): undefined reference to `pthread_create'
/usr/bin/ld: parse-tags.c:(.text+0x1428): undefined reference to `pthread_join'
/usr/bin/ld: read.o: in function `store_tags':
read.c:(.text+0x4b8): undefined reference to `ogg_page_checksum_set'
/usr/bin/ld: read.c:(.text+0x590): undefined reference to `ogg_page_checksum_set'
/usr/bin/ld: read.c:(.text+0x654): undefined reference to `ogg_page_checksum_set'
/usr/bin/ld: read.c:(.text+0x78c): undefined reference to `ogg_page_checksum_set'
/usr/bin/ld: read.o: in function `open_output_file':
read.c:(.text+0x888): undefined reference to `pthread_create'
/usr/bin/ld: read.o: in function `parse_info':
read.c:(.text+0xac4): undefined reference to `ogg_page_bos'
/usr/bin/ld: read.c:(.text+0xad0): undefined reference to `ogg_page_eos'
/usr/bin/ld: read.c:(.text+0xadc): undefined reference to `ogg_page_pageno'
/usr/bin/ld: read.c:(.text+0xae8): undefined reference to `ogg_page_granulepos'
/usr/bin/ld: read.c:(.text+0xb98): undefined reference to `ogg_page_serialno'
/usr/bin/ld: read.c:(.text+0xc58): undefined reference to `ogg_page_pageno'
/usr/bin/ld: read.c:(.text+0xc6c): undefined reference to `ogg_page_pageno'
/usr/bin/ld: read.c:(.text+0xc80): undefined reference to `ogg_page_granulepos'
/usr/bin/ld: read.o: in function `parse_comment':
read.c:(.text+0xd2c): undefined reference to `ogg_page_eos'
/usr/bin/ld: read.c:(.text+0xe3c): undefined reference to `ogg_page_continued'
/usr/bin/ld: read.c:(.text+0xeb8): undefined reference to `pthread_join'
/usr/bin/ld: read.c:(.text+0xedc): undefined reference to `pthread_join'
/usr/bin/ld: read.o: in function `parse_page_sound':
read.c:(.text+0xfc4): undefined reference to `ogg_page_pageno'
/usr/bin/ld: read.c:(.text+0xfe4): undefined reference to `ogg_page_checksum_set'
/usr/bin/ld: read.c:(.text+0x1000): undefined reference to `ogg_page_eos'
/usr/bin/ld: read.o: in function `parse_info_border':
read.c:(.text+0x1054): undefined reference to `ogg_page_continued'
/usr/bin/ld: read.c:(.text+0x1130): undefined reference to `pthread_create'
/usr/bin/ld: read.o: in function `read_page':
read.c:(.text+0x1240): undefined reference to `ogg_sync_pageseek'
/usr/bin/ld: read.c:(.text+0x1268): undefined reference to `ogg_sync_pageseek'
/usr/bin/ld: read.c:(.text+0x12b4): undefined reference to `ogg_page_eos'
/usr/bin/ld: read.c:(.text+0x12cc): undefined reference to `ogg_page_pageno'
/usr/bin/ld: read-flac.o: in function `read_flac':
read-flac.c:(.text+0x3f4): undefined reference to `pthread_create'
/usr/bin/ld: read-flac.c:(.text+0x458): undefined reference to `pthread_join'
/usr/bin/ld: read-flac.c:(.text+0x480): undefined reference to `pthread_join'
/usr/bin/ld: read-flac.c:(.text+0x904): undefined reference to `pthread_join'
/usr/bin/ld: read-flac.c:(.text+0x9d0): undefined reference to `pthread_create'
/usr/bin/ld: read-flac.c:(.text+0xa08): undefined reference to `pthread_join'
/usr/bin/ld: ocutil.o: in function `test_non_opus':
ocutil.c:(.text+0x140): undefined reference to `ogg_page_serialno'
/usr/bin/ld: ocutil.c:(.text+0x15c): undefined reference to `ogg_page_pageno'
/usr/bin/ld: ocutil.c:(.text+0x178): undefined reference to `ogg_page_bos'
/usr/bin/ld: ocutil.c:(.text+0x184): undefined reference to `ogg_page_eos'
/usr/bin/ld: ocutil.c:(.text+0x190): undefined reference to `ogg_page_granulepos'
/usr/bin/ld: ocutil.c:(.text+0x1c4): undefined reference to `ogg_page_bos'
/usr/bin/ld: ocutil.c:(.text+0x1dc): undefined reference to `ogg_page_bos'
/usr/bin/ld: ocutil.c:(.text+0x210): undefined reference to `ogg_page_pageno'
/usr/bin/ld: ocutil.c:(.text+0x228): undefined reference to `ogg_page_pageno'
/usr/bin/ld: ocutil.c:(.text+0x26c): undefined reference to `ogg_page_bos'
/usr/bin/ld: retrieve-tags.o: in function `retrieve_tags':
retrieve-tags.c:(.text+0xad0): undefined reference to `pthread_join'
/usr/bin/ld: retrieve-tags.c:(.text+0xde4): undefined reference to `pthread_create'
/usr/bin/ld: select-codec.o: in function `check_opus':
select-codec.c:(.text+0x344): undefined reference to `ogg_page_checksum_set'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:22: opuscomment] Error 1
make[1]: Leaving directory '/media/sd/pcbak2/Projects/Audio/opuscomment/src'
make: *** [Makefile:2: all] Error 2
make: Leaving directory '/media/sd/pcbak2/Projects/Audio/opuscomment'
lkydev commented 2 years ago

This is caused by a misplaced library reference when linking the executable.

As a temporary mesaure, from the directory containing the source, open src/Makefile.

Change line 22 from

    $(CC) -o opuscomment $(DEFAULT_MACROS) $(CFLAGS) $(LDFLAGS) $(LIBS) $(OBJS)

to

    $(CC) -o opuscomment $(DEFAULT_MACROS) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)

That is, make sure $(LIBS) appear last in the linking step. Now compilation should work.

zvezdochiot commented 2 years ago

Hi @clort81

See https://github.com/hcmiya/opuscomment/pulls