Discussion:
Compiling cmus on Windows
Semen
2012-05-23 16:57:18 UTC
Permalink
Hi.
I tried to install cmus from the pu branch on Windows (Cygwin), but to no
avail.

$ ./configure CONFIG_CDDB=n CONFIG_CDIO=n CONFIG_DISCID=n CONFIG_MODPLUG=n
CONFIG_MIKMOD=n CONFIG_MPC=n CONFIG_MP4=n CONFIG_AAC=n CONFIG_FFMPEG=n
CONFIG_CUE=n CONFIG_ROAR=n CONFIG_ALSA=n CONFIG_ARTS=n CONFIG_OSS=n
CONFIG_SUN=n
checking for program gcc... /usr/bin/gcc
checking for program gcc... /usr/bin/gcc
checking for CFLAGS -std=gnu99 -pipe -Wall -Wshadow -Wcast-align
-Wpointer-arith -Wwrite-strings -Wundef -Wmissing-prototypes
-Wredundant-decls -Wextra -Wno-sign-compare -Wformat-security... yes
checking for CFLAGS -Wdeclaration-after-statement... yes
checking for CFLAGS -Wold-style-definition... yes
checking for CFLAGS -Wno-pointer-sign... yes
checking for CFLAGS -Werror-implicit-function-declaration... yes
checking for CFLAGS -Wno-unused-parameter... yes
checking if CC can generate dependency information... yes
checking byte order... little-endian
checking for DL_LIBS (-ldl -Wl,--export-dynamic)... yes
checking for PTHREAD_LIBS (-lpthread)... yes
checking for realtime scheduling... yes
checking for NCURSES_LIBS (-lncursesw)... yes
checking for working ncurses setup... yes
checking for function resizeterm... yes
checking for function use_default_colors... yes
checking for ICONV_LIBS (-liconv)... yes
taking iconv from libiconv
checking for working iconv... yes
checking for header <byteswap.h>... yes
checking for function strdup... yes
checking for function strndup... yes
checking for program pkg-config... /usr/bin/pkg-config
checking for FLAC_LIBS (pkg-config)... -lFLAC -lm
checking for FLAC_CFLAGS (pkg-config)... -I/usr/include/FLAC
checking for MAD_LIBS (pkg-config)... -lmad
checking for MAD_CFLAGS (pkg-config)...
checking for VORBIS_LIBS (pkg-config)... -lvorbisfile -lvorbis -lm -logg
checking for VORBIS_CFLAGS (pkg-config)...
checking for WAVPACK_LIBS (pkg-config)... -lwavpack -liconv
checking for WAVPACK_CFLAGS (pkg-config)...
checking for PULSE_LIBS (pkg-config)... -lpulse -lpulsecommon-1.1
checking for PULSE_CFLAGS (pkg-config)... -D_REENTRANT
checking for AO_LIBS (pkg-config)... -lao -lpthread -lwinmm
checking for AO_CFLAGS (pkg-config)...
checking for WAVEOUT_LIBS (-lwinmm)... yes
updating config.mk

$ make
CC ape.o
CC browser.o
CC buffer.o
CC cache.o
CC cmdline.o
CC cmus.o
CC command_mode.o
CC comment.o
CC channelmap.o
CC convert.lo
convert.c:1:0: warning: -fPIC ignored for target (all code is position
independent)
CC debug.o
CC discid.o
CC editable.o
CC expr.o
CC filters.o
CC format_print.o
CC gbuf.o
CC glob.o
CC help.o
CC history.o
CC http.o
CC id3.o
GEN .version
CC input.o
CC job.o
CC keys.o
CC keyval.o
CC lib.o
CC load_dir.o
CC locking.o
CC mergesort.o
CC misc.o
CC options.o
CC output.o
CC pcm.o
CC pl.o
CC play_queue.o
CC player.o
CC rbtree.o
CC read_wrapper.o
CC server.o
CC search.o
CC search_mode.o
CC spawn.o
CC tabexp.o
CC tabexp_file.o
CC track.o
CC track_info.o
CC tree.o
CC u_collate.o
CC uchar.o
CC ui_curses.o
CC window.o
CC worker.o
CC xstrjoin.o
CC file.o
CC path.o
CC prog.o
CC xmalloc.o
LD cmus
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld:
warning: --export-dynamic is not supported for PE targets, did you mean
--export-all-symbols?
CC main.o
LD cmus-remote
CC flac.lo
flac.c:1:0: warning: -fPIC ignored for target (all code is position
independent)
gcc -shared -o cmus.exe -Wl,--out-implib=libcmus.a
-Wl,--base-file,cmus.base \
-Wl,--export-all-symbols -Wl,--no-whole-archive ape.o browser.o
buffer.o cache.o cmdline.o cmus.o command_mode.o comment.o channelmap.o
convert.lo debug.o discid.o editable.o expr.o filters.o format_print.o
gbuf.o glob.o help.o history.o http.o id3.o input.o job.o keys.o keyval.o
lib.o load_dir.o locking.o mergesort.o misc.o options.o output.o pcm.o pl.o
play_queue.o player.o rbtree.o read_wrapper.o server.o search.o
search_mode.o spawn.o tabexp.o tabexp_file.o track.o track_info.o tree.o
u_collate.o uchar.o ui_curses.o window.o worker.o xstrjoin.o file.o path.o
prog.o xmalloc.o -lpthread -lncursesw -liconv -ldl -Wl,--export-dynamic
-lm
Creating library file: libcmus.a
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld:
warning: --export-dynamic is not supported for PE targets, did you mean
--export-all-symbols?
dlltool --output-def cmus.def --dllname cmus.exe --export-all-symbols ape.o
browser.o buffer.o cache.o cmdline.o cmus.o command_mode.o comment.o
channelmap.o convert.lo debug.o discid.o editable.o expr.o filters.o
format_print.o gbuf.o glob.o help.o history.o http.o id3.o input.o job.o
keys.o keyval.o lib.o load_dir.o locking.o mergesort.o misc.o options.o
output.o pcm.o pl.o play_queue.o player.o rbtree.o read_wrapper.o server.o
search.o search_mode.o spawn.o tabexp.o tabexp_file.o track.o track_info.o
tree.o u_collate.o uchar.o ui_curses.o window.o worker.o xstrjoin.o file.o
path.o prog.o xmalloc.o
dlltool --base-file cmus.base --dllname cmus.exe --input-def cmus.def
--output-exp cmus.exp
gcc -o cmus.exe -Wl,cmus.exp ape.o browser.o buffer.o cache.o cmdline.o
cmus.o command_mode.o comment.o channelmap.o convert.lo debug.o discid.o
editable.o expr.o filters.o format_print.o gbuf.o glob.o help.o history.o
http.o id3.o input.o job.o keys.o keyval.o lib.o load_dir.o locking.o
mergesort.o misc.o options.o output.o pcm.o pl.o play_queue.o player.o
rbtree.o read_wrapper.o server.o search.o search_mode.o spawn.o tabexp.o
tabexp_file.o track.o track_info.o tree.o u_collate.o uchar.o ui_curses.o
window.o worker.o xstrjoin.o file.o path.o prog.o xmalloc.o -lpthread
-lncursesw -liconv -ldl -Wl,--export-dynamic -lm
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld:
warning: --export-dynamic is not supported for PE targets, did you mean
--export-all-symbols?
LD flac.so
CC mad.lo
mad.c:1:0: warning: -fPIC ignored for target (all code is position
independent)
CC nomad.lo
nomad.c:1:0: warning: -fPIC ignored for target (all code is position
independent)
LD mad.so
CC vorbis.lo
vorbis.c:1:0: warning: -fPIC ignored for target (all code is position
independent)
LD vorbis.so
CC wavpack.lo
wavpack.c:1:0: warning: -fPIC ignored for target (all code is position
independent)
LD wavpack.so
CC wav.lo
wav.c:1:0: warning: -fPIC ignored for target (all code is position
independent)
LD wav.so
CC pulse.lo
pulse.c:1:0: warning: -fPIC ignored for target (all code is position
independent)
LD pulse.so
CC ao.lo
ao.c:1:0: warning: -fPIC ignored for target (all code is position
independent)
LD ao.so
CC waveout.lo
waveout.c:1:0: warning: -fPIC ignored for target (all code is position
independent)
waveout.c: In function 'waveout_get_option':
waveout.c:283:3: error: implicit declaration of function 'snprintf'
waveout.c:283:3: warning: incompatible implicit declaration of built-in
function 'snprintf'
scripts/lib.mk:76: recipe for target `waveout.lo' failed
make: *** [waveout.lo] Error 1

Is this possible to run cmus on Windows? Was it tested?
What compiler/parameters should I use?
Johannes Weißl
2012-05-23 20:27:11 UTC
Permalink
Hi Semen,
Post by Semen
I tried to install cmus from the pu branch on Windows (Cygwin), but to no
avail.
$ ./configure CONFIG_CDDB=n CONFIG_CDIO=n CONFIG_DISCID=n CONFIG_MODPLUG=n
CONFIG_MIKMOD=n CONFIG_MPC=n CONFIG_MP4=n CONFIG_AAC=n CONFIG_FFMPEG=n
CONFIG_CUE=n CONFIG_ROAR=n CONFIG_ALSA=n CONFIG_ARTS=n CONFIG_OSS=n
CONFIG_SUN=n
[...]
waveout.c:283:3: error: implicit declaration of function 'snprintf'
waveout.c:283:3: warning: incompatible implicit declaration of built-in
function 'snprintf'
scripts/lib.mk:76: recipe for target `waveout.lo' failed
make: *** [waveout.lo] Error 1
Is this possible to run cmus on Windows? Was it tested?
What compiler/parameters should I use?
It has been tested, also by me. I tried it again, and for me this error
(implicit declaration of function 'snprintf') is a warning. Maybe your
Cygwin toolchain is newer?

Anyway, the warning (and possibly the error) disappear if <stdio.h> is
included. I will submit a patch in a follow-up mail. Thanks for
reporting!

Grettings,
Johannes
Johannes Weißl
2012-05-23 20:54:16 UTC
Permalink
For me this fixes:
waveout.c:283: warning: implicit declaration of function 'snprintf'

But for the reporter, the warning is an error (possibly newer version of
toolchain?):
waveout.c:283:3: error: implicit declaration of function 'snprintf'

The <stdio.h> header is included after the <windows.h> header, as
suggested e.g. here:
http://en.wikibooks.org/wiki/Windows_Programming/windows.h

Reported-by: Semen <***@gmail.com>
---
waveout.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/waveout.c b/waveout.c
index 8813c3f..43bf20e 100644
--- a/waveout.c
+++ b/waveout.c
@@ -27,6 +27,7 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <mmsystem.h>
+#include <stdio.h>

static HWAVEOUT wave_out;
static sample_format_t waveout_sf;
--
1.7.10
Gregory Petrosyan
2012-05-24 08:18:32 UTC
Permalink
Post by Johannes Weißl
+#include <stdio.h>
Thanks a lot for the quick fix — merged!

Semen, can you please try compiling once again? The patch is available in all
branches of the git repo.

Gregory
Semen
2012-05-24 08:24:06 UTC
Permalink
Hi.
After adding this string the error is gone. I have successfully installed
cmus. Thanks!
Post by Johannes Weißl
Hi Semen,
Post by Semen
I tried to install cmus from the pu branch on Windows (Cygwin), but to no
avail.
$ ./configure CONFIG_CDDB=n CONFIG_CDIO=n CONFIG_DISCID=n
CONFIG_MODPLUG=n
Post by Semen
CONFIG_MIKMOD=n CONFIG_MPC=n CONFIG_MP4=n CONFIG_AAC=n CONFIG_FFMPEG=n
CONFIG_CUE=n CONFIG_ROAR=n CONFIG_ALSA=n CONFIG_ARTS=n CONFIG_OSS=n
CONFIG_SUN=n
[...]
waveout.c:283:3: error: implicit declaration of function 'snprintf'
waveout.c:283:3: warning: incompatible implicit declaration of built-in
function 'snprintf'
scripts/lib.mk:76: recipe for target `waveout.lo' failed
make: *** [waveout.lo] Error 1
Is this possible to run cmus on Windows? Was it tested?
What compiler/parameters should I use?
It has been tested, also by me. I tried it again, and for me this error
(implicit declaration of function 'snprintf') is a warning. Maybe your
Cygwin toolchain is newer?
Anyway, the warning (and possibly the error) disappear if <stdio.h> is
included. I will submit a patch in a follow-up mail. Thanks for
reporting!
Grettings,
Johannes
Loading...