Trouble Linking to Static Libraries

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Trouble Linking to Static Libraries

Jordan Irwin
I am on Windows using MSYS2/MinGW-w64 & I am having trouble linking to some static libraries. The libraries in question were libsndfile & libreadline. I have fixed many of the undefined references, but there are still two that I am having trouble with. The problem occurs when trying to link the fluidsynth.exe executable.

These are the original linker errors I was having:

...
Scanning dependencies of target libfluidsynth
[ 96%] Linking C static library libfluidsynth.a
[ 96%] Built target libfluidsynth
Scanning dependencies of target fluidsynth
[ 98%] Building C object src/CMakeFiles/fluidsynth.dir/fluidsynth.c.obj
[100%] Linking C executable fluidsynth.exe
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x478): undefined reference to `FLAC__StreamDecoderErrorStatusString'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x504): undefined reference to `FLAC__stream_decoder_seek_absolute'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x570): undefined reference to `FLAC__metadata_object_delete'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x5bd): undefined reference to `FLAC__stream_decoder_finish'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x5c7): undefined reference to `FLAC__stream_decoder_delete'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x5d4): undefined reference to `FLAC__stream_encoder_finish'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x5df): undefined reference to `FLAC__stream_encoder_delete'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x8dd): undefined reference to `FLAC__metadata_object_vorbiscomment_find_entry_from'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x11e6): undefined reference to `FLAC__stream_encoder_delete'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x11eb): undefined reference to `FLAC__stream_encoder_new'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1208): undefined reference to `FLAC__stream_encoder_set_channels'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1221): undefined reference to `FLAC__stream_encoder_set_sample_rate'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1238): undefined reference to `FLAC__stream_encoder_set_bits_per_sample'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1252): undefined reference to `FLAC__stream_encoder_set_compression_level'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x150f): undefined reference to `FLAC__stream_encoder_process_interleaved'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x16bf): undefined reference to `FLAC__stream_encoder_process_interleaved'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x182e): undefined reference to `FLAC__stream_encoder_process_interleaved'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x196a): undefined reference to `FLAC__stream_encoder_process_interleaved'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1c40): undefined reference to `FLAC__stream_decoder_get_state'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1c70): undefined reference to `FLAC__stream_decoder_process_single'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1c7e): undefined reference to `FLAC__stream_decoder_get_state'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1c9f): undefined reference to `FLAC__StreamDecoderStateString'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1cd1): undefined reference to `FLAC__StreamDecoderStateString'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x2021): undefined reference to `FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x2044): undefined reference to `FLAC__metadata_object_vorbiscomment_append_comment'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x2065): undefined reference to `FLAC__stream_encoder_set_metadata'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x209c): undefined reference to `FLAC__stream_encoder_init_stream'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x216e): undefined reference to `FLAC__StreamEncoderInitStatusString'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x219b): undefined reference to `FLAC__metadata_object_new'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x240e): undefined reference to `FLAC__stream_decoder_delete'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x2413): undefined reference to `FLAC__stream_decoder_new'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x2425): undefined reference to `FLAC__stream_decoder_set_metadata_respond_all'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x2473): undefined reference to `FLAC__stream_decoder_init_stream'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x248c): undefined reference to `FLAC__stream_decoder_process_until_end_of_metadata'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x24bc): undefined reference to `FLAC__stream_decoder_get_decode_position'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x293): undefined reference to `vorbis_synthesis_read'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x2bb): undefined reference to `vorbis_synthesis_pcmout'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x319): undefined reference to `vorbis_synthesis'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x339): undefined reference to `vorbis_synthesis_pcmout'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x381): undefined reference to `vorbis_synthesis_read'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x502): undefined reference to `vorbis_synthesis_blockin'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x62a): undefined reference to `vorbis_analysis_wrote'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x648): undefined reference to `vorbis_analysis_blockout'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x665): undefined reference to `vorbis_analysis'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x66d): undefined reference to `vorbis_bitrate_addblock'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x68b): undefined reference to `vorbis_bitrate_flushpacket'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x7d1): undefined reference to `vorbis_analysis_buffer'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x8c1): undefined reference to `vorbis_analysis_buffer'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x9a1): undefined reference to `vorbis_analysis_buffer'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xa91): undefined reference to `vorbis_analysis_buffer'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xb48): undefined reference to `vorbis_info_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xb6e): undefined reference to `vorbis_encode_init_vbr'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xb9e): undefined reference to `vorbis_comment_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xbc0): undefined reference to `vorbis_comment_add_tag'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xc06): undefined reference to `vorbis_comment_add_tag'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xc2e): undefined reference to `vorbis_analysis_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xc3d): undefined reference to `vorbis_block_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xc7c): undefined reference to `vorbis_analysis_headerout'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xdd4): undefined reference to `vorbis_block_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xde0): undefined reference to `vorbis_dsp_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xdef): undefined reference to `vorbis_comment_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xdfa): undefined reference to `vorbis_info_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xe32): undefined reference to `vorbis_analysis_wrote'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xe46): undefined reference to `vorbis_analysis_blockout'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xe63): undefined reference to `vorbis_analysis'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xe6b): undefined reference to `vorbis_bitrate_addblock'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xe89): undefined reference to `vorbis_bitrate_flushpacket'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x136f): undefined reference to `vorbis_block_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x137e): undefined reference to `vorbis_dsp_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x138d): undefined reference to `vorbis_comment_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x139a): undefined reference to `vorbis_info_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x13a6): undefined reference to `vorbis_info_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x13b2): undefined reference to `vorbis_comment_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x13ca): undefined reference to `vorbis_synthesis_headerin'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1408): undefined reference to `vorbis_comment_query'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x14a7): undefined reference to `vorbis_synthesis_headerin'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x14ef): undefined reference to `vorbis_synthesis_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x14ff): undefined reference to `vorbis_block_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x165f): undefined reference to `vorbis_comment_query'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x18b0): undefined reference to `vorbis_version_string'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1e34): undefined reference to `vorbis_comment_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1e42): undefined reference to `vorbis_info_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1eca): undefined reference to `vorbis_synthesis_headerin'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1f1a): undefined reference to `vorbis_comment_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1f2c): undefined reference to `vorbis_info_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1f7a): undefined reference to `vorbis_comment_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1f8c): undefined reference to `vorbis_info_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x1c): undefined reference to `speex_decoder_destroy'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x24): undefined reference to `speex_bits_destroy'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x206): undefined reference to `speex_bits_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x40e): undefined reference to `speex_packet_to_header'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x457): undefined reference to `speex_lib_get_mode'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x47f): undefined reference to `speex_decoder_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x4a1): undefined reference to `speex_decoder_ctl'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x4b8): undefined reference to `speex_decoder_ctl'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x4eb): undefined reference to `speex_decoder_ctl'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x544): undefined reference to `speex_std_stereo_request_handler'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x549): undefined reference to `speex_decoder_ctl'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x60c): undefined reference to `speex_decoder_ctl'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(display.o):(.text+0xa59): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(display.o):(.text+0xb6a): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(display.o):(.text+0xbbd): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(display.o):(.text+0x13b4): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(display.o):(.text+0x163f): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(display.o):(.text+0x28cc): more undefined references to `tputs' follow
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0x2cf): undefined reference to `tgetnum'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0x302): undefined reference to `tgetnum'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0x717): undefined reference to `tgetent'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0x74e): undefined reference to `tgetstr'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0x7a1): undefined reference to `tgetflag'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0x7ee): undefined reference to `tgetflag'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0x845): undefined reference to `tgetflag'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0xab6): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0xb52): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0xbc9): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0xc15): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0xc58): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0xcb6): more undefined references to `tputs' follow
collect2.exe: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/fluidsynth.dir/build.make:88: src/fluidsynth.exe] Error 1
make[1]: *** [CMakeFiles/Makefile2:160: src/CMakeFiles/fluidsynth.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

I used the following patch to explicitly link to the static libraries:

--- fluidsynth-2.0.5/src/CMakeLists.txt.orig 2019-07-27 02:01:32.553613900 +0000
+++ fluidsynth-2.0.5/src/CMakeLists.txt 2019-07-27 02:32:03.444643900 +0000
@@ -319,9 +319,9 @@
     ${ALSA_LIBRARIES}
     ${PULSE_LIBRARIES}
     ${PORTAUDIO_LIBRARIES}
-    ${LIBSNDFILE_LIBRARIES}
+    ${LIBSNDFILE_STATIC_LIBRARIES}
     ${DBUS_LIBRARIES}
-    ${READLINE_LIBS}
+    ${READLINE_STATIC_LIBS}
     ${DART_LIBS}
     ${COREAUDIO_LIBS}
     ${COREMIDI_LIBS}

Now I am only getting the following two linker errors:

...
Scanning dependencies of target libfluidsynth
[ 96%] Linking C static library libfluidsynth.a
[ 96%] Built target libfluidsynth
Scanning dependencies of target fluidsynth
[ 98%] Building C object src/CMakeFiles/fluidsynth.dir/fluidsynth.c.obj
[100%] Linking C executable fluidsynth.exe
libfluidsynth.a(fluid_sys.c.obj):fluid_sys.c:(.text+0xc3f): undefined reference to `readline'
libfluidsynth.a(fluid_sys.c.obj):fluid_sys.c:(.text+0xc89): undefined reference to `add_history'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/fluidsynth.dir/build.make:86: src/fluidsynth.exe] Error 1
make[1]: *** [CMakeFiles/Makefile2:160: src/CMakeFiles/fluidsynth.dir/all] Error 2
make: *** [Makefile:152: all] Error 2


I am not sure if there is something wrong with my readline library or this can be fixed in fluidsynth's configuration. Building shared or static library with -DBUILD_SHARED_LIBS=ON/OFF makes no difference.

Thank you,
- Jordan

http://antumdeluge.wordpress.com/

_______________________________________________
fluid-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/fluid-dev
Reply | Threaded
Open this post in threaded view
|

Re: Trouble Linking to Static Libraries

Jordan Irwin
Adding explicit links to libreadline, libhistory, & libtermcap fixed the problem.

--- fluidsynth-2.0.5/src/CMakeLists.txt.orig 2019-07-27 03:34:21.507340600 +0000
+++ fluidsynth-2.0.5/src/CMakeLists.txt 2019-07-27 03:35:01.382388100 +0000
@@ -319,9 +319,12 @@
     ${ALSA_LIBRARIES}
     ${PULSE_LIBRARIES}
     ${PORTAUDIO_LIBRARIES}
-    ${LIBSNDFILE_LIBRARIES}
+    ${LIBSNDFILE_STATIC_LIBRARIES}
     ${DBUS_LIBRARIES}
-    ${READLINE_LIBS}
+    ${READLINE_STATIC_LIBS}
+    readline
+    history
+    termcap
     ${DART_LIBS}
     ${COREAUDIO_LIBS}
     ${COREMIDI_LIBS}


I don't think this is the best solution, but it works.


On Fri, Jul 26, 2019 at 7:59 PM Jordan Irwin <[hidden email]> wrote:
I am on Windows using MSYS2/MinGW-w64 & I am having trouble linking to some static libraries. The libraries in question were libsndfile & libreadline. I have fixed many of the undefined references, but there are still two that I am having trouble with. The problem occurs when trying to link the fluidsynth.exe executable.

These are the original linker errors I was having:

...
Scanning dependencies of target libfluidsynth
[ 96%] Linking C static library libfluidsynth.a
[ 96%] Built target libfluidsynth
Scanning dependencies of target fluidsynth
[ 98%] Building C object src/CMakeFiles/fluidsynth.dir/fluidsynth.c.obj
[100%] Linking C executable fluidsynth.exe
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x478): undefined reference to `FLAC__StreamDecoderErrorStatusString'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x504): undefined reference to `FLAC__stream_decoder_seek_absolute'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x570): undefined reference to `FLAC__metadata_object_delete'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x5bd): undefined reference to `FLAC__stream_decoder_finish'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x5c7): undefined reference to `FLAC__stream_decoder_delete'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x5d4): undefined reference to `FLAC__stream_encoder_finish'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x5df): undefined reference to `FLAC__stream_encoder_delete'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x8dd): undefined reference to `FLAC__metadata_object_vorbiscomment_find_entry_from'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x11e6): undefined reference to `FLAC__stream_encoder_delete'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x11eb): undefined reference to `FLAC__stream_encoder_new'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1208): undefined reference to `FLAC__stream_encoder_set_channels'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1221): undefined reference to `FLAC__stream_encoder_set_sample_rate'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1238): undefined reference to `FLAC__stream_encoder_set_bits_per_sample'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1252): undefined reference to `FLAC__stream_encoder_set_compression_level'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x150f): undefined reference to `FLAC__stream_encoder_process_interleaved'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x16bf): undefined reference to `FLAC__stream_encoder_process_interleaved'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x182e): undefined reference to `FLAC__stream_encoder_process_interleaved'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x196a): undefined reference to `FLAC__stream_encoder_process_interleaved'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1c40): undefined reference to `FLAC__stream_decoder_get_state'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1c70): undefined reference to `FLAC__stream_decoder_process_single'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1c7e): undefined reference to `FLAC__stream_decoder_get_state'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1c9f): undefined reference to `FLAC__StreamDecoderStateString'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x1cd1): undefined reference to `FLAC__StreamDecoderStateString'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x2021): undefined reference to `FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x2044): undefined reference to `FLAC__metadata_object_vorbiscomment_append_comment'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x2065): undefined reference to `FLAC__stream_encoder_set_metadata'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x209c): undefined reference to `FLAC__stream_encoder_init_stream'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x216e): undefined reference to `FLAC__StreamEncoderInitStatusString'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x219b): undefined reference to `FLAC__metadata_object_new'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x240e): undefined reference to `FLAC__stream_decoder_delete'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x2413): undefined reference to `FLAC__stream_decoder_new'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x2425): undefined reference to `FLAC__stream_decoder_set_metadata_respond_all'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x2473): undefined reference to `FLAC__stream_decoder_init_stream'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x248c): undefined reference to `FLAC__stream_decoder_process_until_end_of_metadata'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-flac.o):(.text+0x24bc): undefined reference to `FLAC__stream_decoder_get_decode_position'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x293): undefined reference to `vorbis_synthesis_read'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x2bb): undefined reference to `vorbis_synthesis_pcmout'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x319): undefined reference to `vorbis_synthesis'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x339): undefined reference to `vorbis_synthesis_pcmout'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x381): undefined reference to `vorbis_synthesis_read'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x502): undefined reference to `vorbis_synthesis_blockin'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x62a): undefined reference to `vorbis_analysis_wrote'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x648): undefined reference to `vorbis_analysis_blockout'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x665): undefined reference to `vorbis_analysis'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x66d): undefined reference to `vorbis_bitrate_addblock'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x68b): undefined reference to `vorbis_bitrate_flushpacket'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x7d1): undefined reference to `vorbis_analysis_buffer'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x8c1): undefined reference to `vorbis_analysis_buffer'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x9a1): undefined reference to `vorbis_analysis_buffer'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xa91): undefined reference to `vorbis_analysis_buffer'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xb48): undefined reference to `vorbis_info_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xb6e): undefined reference to `vorbis_encode_init_vbr'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xb9e): undefined reference to `vorbis_comment_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xbc0): undefined reference to `vorbis_comment_add_tag'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xc06): undefined reference to `vorbis_comment_add_tag'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xc2e): undefined reference to `vorbis_analysis_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xc3d): undefined reference to `vorbis_block_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xc7c): undefined reference to `vorbis_analysis_headerout'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xdd4): undefined reference to `vorbis_block_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xde0): undefined reference to `vorbis_dsp_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xdef): undefined reference to `vorbis_comment_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xdfa): undefined reference to `vorbis_info_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xe32): undefined reference to `vorbis_analysis_wrote'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xe46): undefined reference to `vorbis_analysis_blockout'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xe63): undefined reference to `vorbis_analysis'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xe6b): undefined reference to `vorbis_bitrate_addblock'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0xe89): undefined reference to `vorbis_bitrate_flushpacket'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x136f): undefined reference to `vorbis_block_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x137e): undefined reference to `vorbis_dsp_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x138d): undefined reference to `vorbis_comment_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x139a): undefined reference to `vorbis_info_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x13a6): undefined reference to `vorbis_info_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x13b2): undefined reference to `vorbis_comment_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x13ca): undefined reference to `vorbis_synthesis_headerin'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1408): undefined reference to `vorbis_comment_query'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x14a7): undefined reference to `vorbis_synthesis_headerin'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x14ef): undefined reference to `vorbis_synthesis_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x14ff): undefined reference to `vorbis_block_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x165f): undefined reference to `vorbis_comment_query'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x18b0): undefined reference to `vorbis_version_string'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1e34): undefined reference to `vorbis_comment_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1e42): undefined reference to `vorbis_info_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1eca): undefined reference to `vorbis_synthesis_headerin'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1f1a): undefined reference to `vorbis_comment_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1f2c): undefined reference to `vorbis_info_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1f7a): undefined reference to `vorbis_comment_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_vorbis.o):(.text+0x1f8c): undefined reference to `vorbis_info_clear'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x1c): undefined reference to `speex_decoder_destroy'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x24): undefined reference to `speex_bits_destroy'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x206): undefined reference to `speex_bits_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x40e): undefined reference to `speex_packet_to_header'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x457): undefined reference to `speex_lib_get_mode'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x47f): undefined reference to `speex_decoder_init'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x4a1): undefined reference to `speex_decoder_ctl'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x4b8): undefined reference to `speex_decoder_ctl'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x4eb): undefined reference to `speex_decoder_ctl'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x544): undefined reference to `speex_std_stereo_request_handler'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x549): undefined reference to `speex_decoder_ctl'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib/libsndfile.a(libsndfile_la-ogg_speex.o):(.text+0x60c): undefined reference to `speex_decoder_ctl'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(display.o):(.text+0xa59): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(display.o):(.text+0xb6a): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(display.o):(.text+0xbbd): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(display.o):(.text+0x13b4): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(display.o):(.text+0x163f): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(display.o):(.text+0x28cc): more undefined references to `tputs' follow
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0x2cf): undefined reference to `tgetnum'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0x302): undefined reference to `tgetnum'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0x717): undefined reference to `tgetent'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0x74e): undefined reference to `tgetstr'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0x7a1): undefined reference to `tgetflag'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0x7ee): undefined reference to `tgetflag'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0x845): undefined reference to `tgetflag'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0xab6): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0xb52): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0xbc9): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0xc15): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0xc58): undefined reference to `tputs'
C:/Development/MSYS2/mingw32/bin/../lib/gcc/i686-w64-mingw32/9.1.0/../../../../lib\libreadline.a(terminal.o):(.text+0xcb6): more undefined references to `tputs' follow
collect2.exe: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/fluidsynth.dir/build.make:88: src/fluidsynth.exe] Error 1
make[1]: *** [CMakeFiles/Makefile2:160: src/CMakeFiles/fluidsynth.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

I used the following patch to explicitly link to the static libraries:

--- fluidsynth-2.0.5/src/CMakeLists.txt.orig 2019-07-27 02:01:32.553613900 +0000
+++ fluidsynth-2.0.5/src/CMakeLists.txt 2019-07-27 02:32:03.444643900 +0000
@@ -319,9 +319,9 @@
     ${ALSA_LIBRARIES}
     ${PULSE_LIBRARIES}
     ${PORTAUDIO_LIBRARIES}
-    ${LIBSNDFILE_LIBRARIES}
+    ${LIBSNDFILE_STATIC_LIBRARIES}
     ${DBUS_LIBRARIES}
-    ${READLINE_LIBS}
+    ${READLINE_STATIC_LIBS}
     ${DART_LIBS}
     ${COREAUDIO_LIBS}
     ${COREMIDI_LIBS}

Now I am only getting the following two linker errors:

...
Scanning dependencies of target libfluidsynth
[ 96%] Linking C static library libfluidsynth.a
[ 96%] Built target libfluidsynth
Scanning dependencies of target fluidsynth
[ 98%] Building C object src/CMakeFiles/fluidsynth.dir/fluidsynth.c.obj
[100%] Linking C executable fluidsynth.exe
libfluidsynth.a(fluid_sys.c.obj):fluid_sys.c:(.text+0xc3f): undefined reference to `readline'
libfluidsynth.a(fluid_sys.c.obj):fluid_sys.c:(.text+0xc89): undefined reference to `add_history'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/fluidsynth.dir/build.make:86: src/fluidsynth.exe] Error 1
make[1]: *** [CMakeFiles/Makefile2:160: src/CMakeFiles/fluidsynth.dir/all] Error 2
make: *** [Makefile:152: all] Error 2


I am not sure if there is something wrong with my readline library or this can be fixed in fluidsynth's configuration. Building shared or static library with -DBUILD_SHARED_LIBS=ON/OFF makes no difference.

Thank you,
- Jordan

http://antumdeluge.wordpress.com/

_______________________________________________
fluid-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/fluid-dev
Reply | Threaded
Open this post in threaded view
|

Re: Trouble Linking to Static Libraries

fluid-dev mailing list
Thanks for the report. However I'm afraid, we cannot simply link against the private dependencies of the libraries that we depend on. Most users link against shared libraries. Always including e.g. LIBSNDFILE_STATIC_LIBRARIES would result in unnecessary dependencies like FLAC and OGG/Vorbis that are hard to fulfill esp. for windows users who just downloaded the prebuilt libsndfile from mega-nerd.

On the other hand, there doesn't really seem to be a way to influence pkgconfig whether it found static or shared libs. Hence we cannot know when to use the special STATIC_LIBRARIES flag.

Also, getting the private dependencies of readline correct is tricky, because readline does not provide a pkgconfig file.

I currently don't see how to solve this, sry.


Tom



_______________________________________________
fluid-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/fluid-dev