GithubHelp home page GithubHelp logo

bucciarati / mpc123 Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 104 KB

Musepack Console audio player

License: GNU General Public License v2.0

C 88.89% Makefile 4.48% Roff 6.63%
audio c musepack musepack-player oss

mpc123's People

Contributors

bucciarati avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

mpc123's Issues

FTBS: shared libraries not positioned after object files

On Linux Mint 18 / Ubuntu 16.04, mpc123 fails to build

/usr/bin/cc  -Wall -O2 -lao -lmpcdec -o mpc123  player.o  ao.o  reader_file.o  playlist.o  signals.o shuffle.o  reader.o mpc123.c
player.o: In function `do_play_stream':
player.c:(.text+0x29): undefined reference to `mpc_demux_init'
player.c:(.text+0x44): undefined reference to `mpc_demux_get_info'
player.c:(.text+0x82): undefined reference to `mpc_demux_decode'
ao.o: In function `mpc123_ao_init':
ao.c:(.text+0xb9): undefined reference to `ao_initialize'
ao.c:(.text+0xc5): undefined reference to `ao_driver_id'
ao.c:(.text+0x174): undefined reference to `ao_driver_info'
ao.c:(.text+0x1f2): undefined reference to `ao_open_file'
ao.c:(.text+0x26e): undefined reference to `ao_open_live'
ao.o: In function `mpc123_ao_done':
ao.c:(.text+0x46b): undefined reference to `ao_close'
ao.o: In function `mpc123_ao_play':
ao.c:(.text+0x3fa): undefined reference to `ao_play'
collect2: error: ld returned 1 exit status
Makefile:49: recipe for target 'mpc123' failed
make: *** [mpc123] Error 1

As "An Introduction to GCC - for the GNU compilers gcc and g++" at http://www.network-theory.co.uk/docs/gccintro/gccintro_18.html explains

2.7.1 Link order of libraries

The traditional behavior of linkers is to search for external functions from left to right in the libraries specified on the command line. This means that a library containing the definition of a function should appear after any source files or object files which use it. This includes libraries specified with the short-cut -l option

Thus the share object library files, specifed with "-lao -lmpcdec", have to be placed after the object files and so LDFLAGS needs moving to the end of the line 47 in the Makefile

--- Makefile.orig      2017-03-29 21:41:53.178405206 +0200
+++ Makefile           2017-03-29 21:41:53.178405206 +0200
@@ -47,7 +47,7 @@

 $(TARGET): $(DEPS) $(TARGET).c $(MOS)
        @echo Building mpc123 version $(MAJOR).$(MINOR) ...
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(DEPS) $(TARGET).c
+       $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $(DEPS) $(TARGET).c $(LDFLAGS)

.PHONY: clean tarball

and the executable then builds successfully with

Building mpc123 version 0.2 ...
/usr/bin/cc  -Wall -O2 -o mpc123  player.o  ao.o  reader_file.o  playlist.o  signals.o  shuffle.o  reader.o mpc123.c -lao -lmpcdec

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.