Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failing on debian/devuan #32

Open
clort81 opened this issue May 10, 2021 · 2 comments
Open

Build failing on debian/devuan #32

clort81 opened this issue May 10, 2021 · 2 comments

Comments

@clort81
Copy link

clort81 commented May 10, 2021

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
Copy link

lkydev commented Jul 15, 2022

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
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants