bucciarati / mpc123 Goto Github PK
View Code? Open in Web Editor NEWMusepack Console audio player
License: GNU General Public License v2.0
Musepack Console audio player
License: GNU General Public License v2.0
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.