notandy / ympd

Standalone MPD Web GUI written in C, utilizing Websockets and Bootstrap/JS
http://www.ympd.org
GNU General Public License v2.0
515 stars 143 forks source link

Build fails on OpenBSD #65

Closed kfarwell closed 9 years ago

kfarwell commented 9 years ago

OpenBSD 5.6 i386 gcc 4.2.1 20070719 cmake 2.8.12.2 libmpdclient 2.9

# pwd
/root/ympd/build
# cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.27.1") 
-- Found LibMPDClient: /usr/local/lib/libmpdclient.so.2.0  
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /root/ympd/build
# make
Scanning dependencies of target mkdata
[ 12%] Building C object CMakeFiles/mkdata.dir/tools/mkdata.c.o
Linking C executable mkdata
[ 12%] Built target mkdata
[ 25%] Generating assets.c
Scanning dependencies of target ympd
[ 37%] Building C object CMakeFiles/ympd.dir/src/ympd.c.o
[ 50%] Building C object CMakeFiles/ympd.dir/src/mpd_client.c.o
/root/ympd/src/mpd_client.c:24:24: error: mpd/client.h: No such file or directory
/root/ympd/src/mpd_client.c: In function 'callback_mpd':
/root/ympd/src/mpd_client.c:61: warning: implicit declaration of function 'mpd_run_update'
/root/ympd/src/mpd_client.c:64: warning: implicit declaration of function 'mpd_run_toggle_pause'
/root/ympd/src/mpd_client.c:67: warning: implicit declaration of function 'mpd_run_previous'
/root/ympd/src/mpd_client.c:70: warning: implicit declaration of function 'mpd_run_next'
/root/ympd/src/mpd_client.c:73: warning: implicit declaration of function 'mpd_run_play'
/root/ympd/src/mpd_client.c:76: warning: implicit declaration of function 'mpd_run_stop'
/root/ympd/src/mpd_client.c:79: warning: implicit declaration of function 'mpd_run_clear'
/root/ympd/src/mpd_client.c:83: warning: implicit declaration of function 'mpd_run_delete_id'
/root/ympd/src/mpd_client.c:87: warning: implicit declaration of function 'mpd_run_play_id'
/root/ympd/src/mpd_client.c:91: warning: implicit declaration of function 'mpd_run_random'
/root/ympd/src/mpd_client.c:95: warning: implicit declaration of function 'mpd_run_repeat'
/root/ympd/src/mpd_client.c:99: warning: implicit declaration of function 'mpd_run_consume'
/root/ympd/src/mpd_client.c:103: warning: implicit declaration of function 'mpd_run_single'
/root/ympd/src/mpd_client.c:107: warning: implicit declaration of function 'mpd_run_crossfade'
/root/ympd/src/mpd_client.c:111: warning: implicit declaration of function 'mpd_run_set_volume'
/root/ympd/src/mpd_client.c:115: warning: implicit declaration of function 'mpd_run_seek_id'
/root/ympd/src/mpd_client.c:122: warning: unknown conversion type character 'm' in format
/root/ympd/src/mpd_client.c:122: warning: too many arguments for format
/root/ympd/src/mpd_client.c:129: warning: unknown conversion type character 'm' in format
/root/ympd/src/mpd_client.c:129: warning: too many arguments for format
/root/ympd/src/mpd_client.c:131: warning: implicit declaration of function 'mpd_run_add'
/root/ympd/src/mpd_client.c:136: warning: unknown conversion type character 'm' in format
/root/ympd/src/mpd_client.c:136: warning: too many arguments for format
/root/ympd/src/mpd_client.c:138: warning: implicit declaration of function 'mpd_run_add_id'
/root/ympd/src/mpd_client.c:145: warning: unknown conversion type character 'm' in format
/root/ympd/src/mpd_client.c:145: warning: too many arguments for format
/root/ympd/src/mpd_client.c:147: warning: implicit declaration of function 'mpd_run_load'
/root/ympd/src/mpd_client.c:152: warning: unknown conversion type character 'm' in format
/root/ympd/src/mpd_client.c:152: warning: too many arguments for format
/root/ympd/src/mpd_client.c:162: warning: unknown conversion type character 'm' in format
/root/ympd/src/mpd_client.c:162: warning: too many arguments for format
/root/ympd/src/mpd_client.c:178: warning: unknown conversion type character 'm' in format
/root/ympd/src/mpd_client.c:178: warning: too many arguments for format
/root/ympd/src/mpd_client.c:191: warning: implicit declaration of function 'mpd_connection_get_error'
/root/ympd/src/mpd_client.c:191: error: 'MPD_ERROR_SUCCESS' undeclared (first use in this function)
/root/ympd/src/mpd_client.c:191: error: (Each undeclared identifier is reported only once
/root/ympd/src/mpd_client.c:191: error: for each function it appears in.)
/root/ympd/src/mpd_client.c:194: warning: implicit declaration of function 'mpd_connection_get_error_message'
/root/ympd/src/mpd_client.c:194: warning: format '%s' expects type 'char *', but argument 4 has type 'int'
/root/ympd/src/mpd_client.c:197: warning: implicit declaration of function 'mpd_connection_clear_error'
/root/ympd/src/mpd_client.c: In function 'mpd_poll':
/root/ympd/src/mpd_client.c:268: warning: implicit declaration of function 'mpd_connection_new'
/root/ympd/src/mpd_client.c:268: warning: assignment makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:275: error: 'MPD_ERROR_SUCCESS' undeclared (first use in this function)
/root/ympd/src/mpd_client.c:276: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
/root/ympd/src/mpd_client.c:283: warning: implicit declaration of function 'mpd_run_password'
/root/ympd/src/mpd_client.c:285: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
/root/ympd/src/mpd_client.c:293: warning: implicit declaration of function 'mpd_connection_set_timeout'
/root/ympd/src/mpd_client.c:303: warning: implicit declaration of function 'mpd_connection_free'
/root/ympd/src/mpd_client.c: At top level:
/root/ympd/src/mpd_client.c:315: warning: 'struct mpd_song' declared inside parameter list
/root/ympd/src/mpd_client.c:315: warning: its scope is only this definition or declaration, which is probably not what you want
/root/ympd/src/mpd_client.c: In function 'mpd_get_title':
/root/ympd/src/mpd_client.c:319: warning: implicit declaration of function 'mpd_song_get_tag'
/root/ympd/src/mpd_client.c:319: error: 'MPD_TAG_TITLE' undeclared (first use in this function)
/root/ympd/src/mpd_client.c:321: warning: implicit declaration of function 'mpd_song_get_uri'
/root/ympd/src/mpd_client.c: In function 'mpd_put_state':
/root/ympd/src/mpd_client.c:332: warning: implicit declaration of function 'mpd_run_status'
/root/ympd/src/mpd_client.c:332: warning: assignment makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:334: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
/root/ympd/src/mpd_client.c:346: warning: implicit declaration of function 'mpd_status_get_state'
/root/ympd/src/mpd_client.c:347: warning: implicit declaration of function 'mpd_status_get_volume'
/root/ympd/src/mpd_client.c:348: warning: implicit declaration of function 'mpd_status_get_repeat'
/root/ympd/src/mpd_client.c:349: warning: implicit declaration of function 'mpd_status_get_single'
/root/ympd/src/mpd_client.c:350: warning: implicit declaration of function 'mpd_status_get_crossfade'
/root/ympd/src/mpd_client.c:351: warning: implicit declaration of function 'mpd_status_get_consume'
/root/ympd/src/mpd_client.c:352: warning: implicit declaration of function 'mpd_status_get_random'
/root/ympd/src/mpd_client.c:353: warning: implicit declaration of function 'mpd_status_get_song_pos'
/root/ympd/src/mpd_client.c:354: warning: implicit declaration of function 'mpd_status_get_elapsed_time'
/root/ympd/src/mpd_client.c:355: warning: implicit declaration of function 'mpd_status_get_total_time'
/root/ympd/src/mpd_client.c:356: warning: implicit declaration of function 'mpd_status_get_song_id'
/root/ympd/src/mpd_client.c:359: warning: implicit declaration of function 'mpd_status_get_queue_version'
/root/ympd/src/mpd_client.c:360: warning: implicit declaration of function 'mpd_status_free'
/root/ympd/src/mpd_client.c: In function 'mpd_put_current_song':
/root/ympd/src/mpd_client.c:370: warning: implicit declaration of function 'mpd_run_current_song'
/root/ympd/src/mpd_client.c:370: warning: assignment makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:375: warning: implicit declaration of function 'mpd_song_get_pos'
/root/ympd/src/mpd_client.c:377: warning: passing argument 1 of 'mpd_get_title' from incompatible pointer type
/root/ympd/src/mpd_client.c:379: error: 'MPD_TAG_ARTIST' undeclared (first use in this function)
/root/ympd/src/mpd_client.c:379: warning: comparison between pointer and integer
/root/ympd/src/mpd_client.c:382: warning: passing argument 3 of 'json_emit_quoted_str' makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:385: error: 'MPD_TAG_ALBUM' undeclared (first use in this function)
/root/ympd/src/mpd_client.c:385: warning: comparison between pointer and integer
/root/ympd/src/mpd_client.c:388: warning: passing argument 3 of 'json_emit_quoted_str' makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:392: warning: implicit declaration of function 'mpd_song_free'
/root/ympd/src/mpd_client.c:393: warning: implicit declaration of function 'mpd_response_finish'
/root/ympd/src/mpd_client.c: In function 'mpd_put_queue':
/root/ympd/src/mpd_client.c:404: warning: implicit declaration of function 'mpd_send_list_queue_range_meta'
/root/ympd/src/mpd_client.c:405: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
/root/ympd/src/mpd_client.c:405: warning: format '%s' expects type 'char *', but argument 4 has type 'int'
/root/ympd/src/mpd_client.c:409: warning: implicit declaration of function 'mpd_recv_entity'
/root/ympd/src/mpd_client.c:409: warning: assignment makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:412: warning: implicit declaration of function 'mpd_entity_get_type'
/root/ympd/src/mpd_client.c:412: error: 'MPD_ENTITY_TYPE_SONG' undeclared (first use in this function)
/root/ympd/src/mpd_client.c:413: warning: implicit declaration of function 'mpd_entity_get_song'
/root/ympd/src/mpd_client.c:413: warning: assignment makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:416: warning: implicit declaration of function 'mpd_song_get_id'
/root/ympd/src/mpd_client.c:420: warning: implicit declaration of function 'mpd_song_get_duration'
/root/ympd/src/mpd_client.c:422: warning: passing argument 1 of 'mpd_get_title' from incompatible pointer type
/root/ympd/src/mpd_client.c:425: warning: implicit declaration of function 'mpd_entity_free'
/root/ympd/src/mpd_client.c: In function 'mpd_put_browse':
/root/ympd/src/mpd_client.c:442: warning: implicit declaration of function 'mpd_send_list_meta'
/root/ympd/src/mpd_client.c:443: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
/root/ympd/src/mpd_client.c:443: warning: format '%s' expects type 'char *', but argument 4 has type 'int'
/root/ympd/src/mpd_client.c:447: warning: assignment makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:468: error: 'MPD_ENTITY_TYPE_UNKNOWN' undeclared (first use in this function)
/root/ympd/src/mpd_client.c:471: error: 'MPD_ENTITY_TYPE_SONG' undeclared (first use in this function)
/root/ympd/src/mpd_client.c:472: warning: assignment makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:474: warning: passing argument 3 of 'json_emit_quoted_str' makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:478: warning: passing argument 1 of 'mpd_get_title' from incompatible pointer type
/root/ympd/src/mpd_client.c:482: error: 'MPD_ENTITY_TYPE_DIRECTORY' undeclared (first use in this function)
/root/ympd/src/mpd_client.c:483: warning: implicit declaration of function 'mpd_entity_get_directory'
/root/ympd/src/mpd_client.c:483: warning: assignment makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:486: warning: implicit declaration of function 'mpd_directory_get_path'
/root/ympd/src/mpd_client.c:486: warning: passing argument 3 of 'json_emit_quoted_str' makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:490: error: 'MPD_ENTITY_TYPE_PLAYLIST' undeclared (first use in this function)
/root/ympd/src/mpd_client.c:491: warning: implicit declaration of function 'mpd_entity_get_playlist'
/root/ympd/src/mpd_client.c:491: warning: assignment makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:493: warning: implicit declaration of function 'mpd_playlist_get_path'
/root/ympd/src/mpd_client.c:493: warning: passing argument 3 of 'json_emit_quoted_str' makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:501: error: 'MPD_ERROR_SUCCESS' undeclared (first use in this function)
/root/ympd/src/mpd_client.c:502: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
/root/ympd/src/mpd_client.c: In function 'mpd_search':
/root/ympd/src/mpd_client.c:521: warning: implicit declaration of function 'mpd_search_db_songs'
/root/ympd/src/mpd_client.c:521: error: 'false' undeclared (first use in this function)
/root/ympd/src/mpd_client.c:522: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
/root/ympd/src/mpd_client.c:522: warning: format '%s' expects type 'char *', but argument 4 has type 'int'
/root/ympd/src/mpd_client.c:523: warning: implicit declaration of function 'mpd_search_add_any_tag_constraint'
/root/ympd/src/mpd_client.c:523: error: 'MPD_OPERATOR_DEFAULT' undeclared (first use in this function)
/root/ympd/src/mpd_client.c:524: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
/root/ympd/src/mpd_client.c:524: warning: format '%s' expects type 'char *', but argument 4 has type 'int'
/root/ympd/src/mpd_client.c:525: warning: implicit declaration of function 'mpd_search_commit'
/root/ympd/src/mpd_client.c:526: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
/root/ympd/src/mpd_client.c:526: warning: format '%s' expects type 'char *', but argument 4 has type 'int'
/root/ympd/src/mpd_client.c:530: warning: implicit declaration of function 'mpd_recv_song'
/root/ympd/src/mpd_client.c:530: warning: assignment makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:532: warning: passing argument 3 of 'json_emit_quoted_str' makes pointer from integer without a cast
/root/ympd/src/mpd_client.c:536: warning: passing argument 1 of 'mpd_get_title' from incompatible pointer type
*** Error 1 in . (CMakeFiles/ympd.dir/build.make:105 'CMakeFiles/ympd.dir/src/mpd_client.c.o': /usr/bin/cc  -DNS_ENABLE_IPV6 -std=gnu99 -Wal...)
*** Error 1 in . (CMakeFiles/Makefile2:99 'CMakeFiles/ympd.dir/all')
*** Error 1 in /root/ympd/build (Makefile:117 'all')
ajs124 commented 9 years ago

Do you have libmpdclient client installed?

kfarwell commented 9 years ago

Yes, 2.9 installed from the 386 package in OpenBSD 5.6.

ajs124 commented 9 years ago

Weird, because this error /root/ympd/src/mpd_client.c:24:24: error: mpd/client.h: No such file or directory indicates that the headers are either missing or in an unexpected path.

Does OpenBSD split dev and bin packages for libraries? (debian does this iirc)

kfarwell commented 9 years ago

Nope, just one package per library: libmpdclient-2.9.tgz in this case.

cmake finds it... -- Found LibMPDClient: /usr/local/lib/libmpdclient.so.2.0

ajs124 commented 9 years ago

That's not the file you're missing or that's misplaced.

What you seem to be missing are the headers, which might be part of the package, but are apparently not found by your compiler. What's the output of locate client.h|grep mpd (assuming you have locate).

kfarwell commented 9 years ago
# locate client.h|grep mpd
/usr/local/include/mpd/client.h
ajs124 commented 9 years ago

There is a stackoverflow question where someone appears to have the same problem as you. It's sadly unanswered…

notandy commented 9 years ago

I just commited 3701a8510b, it fixes building with openbsd, but sadly openbsd libc doesn't support the %m formatstring, so it just segfaults when searching for something. I will create a new bug report for it.

notandy commented 9 years ago

openbsd build should work now :)