2010-11-23 69 views
8

從源代碼編譯FluidSynth 1.1.1。我有使用Visual C++ Express 2010的glib無法解析的外部符號,我如何在IDE中正確鏈接glib.lib?我是否也需要wsock庫?無法解析的外部符號與glib和VS C++

1>------ Build started: Project: fluidsynth_dll, Configuration: Release Win32 ------ 
2>------ Build started: Project: fluidsynth_lib, Configuration: Release Win32 ------ 
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\Users\Wildfire\Desktop\fluidsynth-1.1.1\winbuild\fluidsynth_dll\.\Release\fluidsynth_dll.dll) does not match the Linker's OutputFile property value (C:\Users\Wildfire\Desktop\fluidsynth-1.1.1\winbuild\fluidsynth.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile). 
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(992,5): warning MSB8012: TargetName(fluidsynth_dll) does not match the Linker's OutputFile property value (fluidsynth). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile). 
2> fluid_adriver.c 
1>  Creating library .\Release/fluidsynth.lib and object .\Release/fluidsynth.exp 
1>fluid_voice.obj : error LNK2019: unresolved external symbol _g_atomic_int_add referenced in function _new_fluid_voice 
1>fluid_chan.obj : error LNK2001: unresolved external symbol _g_atomic_int_add 
1>fluid_hash.obj : error LNK2001: unresolved external symbol _g_atomic_int_add 
1>fluid_synth.obj : error LNK2001: unresolved external symbol _g_atomic_int_add 
1>fluid_tuning.obj : error LNK2001: unresolved external symbol _g_atomic_int_add 
1>fluid_chan.obj : error LNK2019: unresolved external symbol _g_atomic_int_compare_and_exchange referenced in function _fluid_channel_set_sfont_bank_prog 
1>fluid_synth.obj : error LNK2001: unresolved external symbol _g_atomic_int_compare_and_exchange 
1>fluid_synth.obj : error LNK2001: unresolved external symbol __imp__g_thread_functions_for_glib_use 
1>fluid_sys.obj : error LNK2001: unresolved external symbol __imp__g_thread_functions_for_glib_use 
1>fluid_winmidi.obj : error LNK2001: unresolved external symbol __imp__g_thread_functions_for_glib_use 
1>fluid_cmd.obj : error LNK2001: unresolved external symbol __imp__g_thread_functions_for_glib_use 
1>fluid_event.obj : error LNK2001: unresolved external symbol __imp__g_thread_functions_for_glib_use 
1>fluid_midi_router.obj : error LNK2001: unresolved external symbol __imp__g_thread_functions_for_glib_use 
1>fluid_seq.obj : error LNK2001: unresolved external symbol __imp__g_thread_functions_for_glib_use 
1>fluid_cmd.obj : error LNK2019: unresolved external symbol _g_static_mutex_get_mutex_impl referenced in function _fluid_server_add_client 
1>fluid_event.obj : error LNK2001: unresolved external symbol _g_static_mutex_get_mutex_impl 
1>fluid_midi_router.obj : error LNK2001: unresolved external symbol _g_static_mutex_get_mutex_impl 
1>fluid_seq.obj : error LNK2001: unresolved external symbol _g_static_mutex_get_mutex_impl 
1>fluid_settings.obj : error LNK2001: unresolved external symbol __imp__g_threads_got_initialized 
1>fluid_synth.obj : error LNK2001: unresolved external symbol __imp__g_threads_got_initialized 
1>fluid_sys.obj : error LNK2001: unresolved external symbol __imp__g_threads_got_initialized 
1>fluid_winmidi.obj : error LNK2001: unresolved external symbol __imp__g_threads_got_initialized 
1>fluid_cmd.obj : error LNK2001: unresolved external symbol __imp__g_threads_got_initialized 
1>fluid_event.obj : error LNK2001: unresolved external symbol __imp__g_threads_got_initialized 
1>fluid_midi_router.obj : error LNK2001: unresolved external symbol __imp__g_threads_got_initialized 
1>fluid_seq.obj : error LNK2001: unresolved external symbol __imp__g_threads_got_initialized 
1>fluid_cmd.obj : error LNK2019: unresolved external symbol _g_static_mutex_init referenced in function _new_fluid_server 
1>fluid_event.obj : error LNK2001: unresolved external symbol _g_static_mutex_init 
1>fluid_midi_router.obj : error LNK2001: unresolved external symbol _g_static_mutex_init 
1>fluid_seq.obj : error LNK2001: unresolved external symbol _g_static_mutex_init 
1>fluid_settings.obj : error LNK2001: unresolved external symbol _g_thread_init 
1>fluid_synth.obj : error LNK2019: unresolved external symbol _g_thread_init referenced in function _fluid_synth_cc_LOCAL 
1>fluid_sys.obj : error LNK2001: unresolved external symbol _g_thread_init 
1>fluid_winmidi.obj : error LNK2001: unresolved external symbol _g_thread_init 
1>fluid_cmd.obj : error LNK2001: unresolved external symbol _g_thread_init 
1>fluid_event.obj : error LNK2001: unresolved external symbol _g_thread_init 
1>fluid_midi_router.obj : error LNK2001: unresolved external symbol _g_thread_init 
1>fluid_seq.obj : error LNK2001: unresolved external symbol _g_thread_init 
1>fluid_event.obj : error LNK2019: unresolved external symbol _g_static_mutex_free referenced in function __fluid_evt_heap_free 
1>fluid_midi_router.obj : error LNK2001: unresolved external symbol _g_static_mutex_free 
1>fluid_seq.obj : error LNK2001: unresolved external symbol _g_static_mutex_free 
1>fluid_settings.obj : error LNK2019: unresolved external symbol _g_log referenced in function _new_fluid_str_setting 
1>fluid_synth.obj : error LNK2001: unresolved external symbol _g_log 
1>fluid_sys.obj : error LNK2001: unresolved external symbol _g_log 
1>fluid_tuning.obj : error LNK2001: unresolved external symbol _g_log 
1>fluid_event_queue.obj : error LNK2001: unresolved external symbol _g_log 
1>fluid_filerenderer.obj : error LNK2001: unresolved external symbol _g_log 
1>fluid_hash.obj : error LNK2001: unresolved external symbol _g_log 
1>fluid_midi_router.obj : error LNK2001: unresolved external symbol _g_log 
1>fluid_hash.obj : error LNK2019: unresolved external symbol _g_atomic_int_exchange_and_add referenced in function _fluid_hashtable_unref 
1>fluid_settings.obj : error LNK2019: unresolved external symbol _g_static_rec_mutex_free referenced in function _delete_fluid_settings 
1>fluid_synth.obj : error LNK2001: unresolved external symbol _g_static_rec_mutex_free 
1>fluid_settings.obj : error LNK2019: unresolved external symbol _g_static_rec_mutex_unlock referenced in function _fluid_settings_get_type 
1>fluid_synth.obj : error LNK2001: unresolved external symbol _g_static_rec_mutex_unlock 
1>fluid_settings.obj : error LNK2019: unresolved external symbol _g_static_rec_mutex_lock referenced in function _fluid_settings_get_type 
1>fluid_synth.obj : error LNK2001: unresolved external symbol _g_static_rec_mutex_lock 
1>fluid_settings.obj : error LNK2019: unresolved external symbol _g_static_rec_mutex_init referenced in function _new_fluid_settings 
1>fluid_synth.obj : error LNK2001: unresolved external symbol _g_static_rec_mutex_init 
1>fluid_synth.obj : error LNK2019: unresolved external symbol _g_static_private_free referenced in function _delete_fluid_synth 
1>fluid_synth.obj : error LNK2019: unresolved external symbol _g_thread_self referenced in function _fluid_synth_alloc_voice 
1>fluid_synth.obj : error LNK2019: unresolved external symbol _g_static_private_set referenced in function _fluid_synth_tuning_iteration_start 
1>fluid_synth.obj : error LNK2019: unresolved external symbol _g_static_private_get referenced in function _fluid_synth_tuning_iteration_next 
1>fluid_synth.obj : error LNK2019: unresolved external symbol _g_atomic_pointer_compare_and_exchange referenced in function _fluid_synth_get_event_queue 
1>fluid_synth.obj : error LNK2019: unresolved external symbol _g_static_private_init referenced in function _new_fluid_synth 
1>fluid_sys.obj : error LNK2019: unresolved external symbol _g_get_current_time referenced in function _fluid_curtime 
1>fluid_sys.obj : error LNK2019: unresolved external symbol _g_clear_error referenced in function _new_fluid_thread 
1>fluid_sys.obj : error LNK2019: unresolved external symbol _g_thread_create_full referenced in function _new_fluid_thread 
1>fluid_sys.obj : error LNK2019: unresolved external symbol _g_thread_join referenced in function _fluid_thread_join 
1>fluid_sys.obj : error LNK2019: unresolved external symbol _g_usleep referenced in function _fluid_timer_run 
1>fluid_sys.obj : error LNK2019: unresolved external symbol [email protected] referenced in function _fluid_istream_gets 
1>fluid_sys.obj : error LNK2019: unresolved external symbol [email protected] referenced in function _fluid_ostream_printf 
1>fluid_sys.obj : error LNK2019: unresolved external symbol [email protected] referenced in function _fluid_socket_close 
1>fluid_sys.obj : error LNK2019: unresolved external symbol [email protected] referenced in function _fluid_server_socket_run 
1>fluid_sys.obj : error LNK2019: unresolved external symbol [email protected] referenced in function _fluid_server_socket_run 
1>fluid_sys.obj : error LNK2019: unresolved external symbol [email protected] referenced in function _fluid_server_socket_run 
1>fluid_sys.obj : error LNK2019: unresolved external symbol [email protected] referenced in function _new_fluid_server_socket 
1>fluid_sys.obj : error LNK2019: unresolved external symbol [email protected] referenced in function _new_fluid_server_socket 
1>fluid_sys.obj : error LNK2019: unresolved external symbol [email protected] referenced in function _new_fluid_server_socket 
1>fluid_sys.obj : error LNK2019: unresolved external symbol [email protected] referenced in function _new_fluid_server_socket 
1>fluid_sys.obj : error LNK2019: unresolved external symbol [email protected] referenced in function _new_fluid_server_socket 
1>fluid_sys.obj : error LNK2019: unresolved external symbol [email protected] referenced in function _new_fluid_server_socket 
1>fluid_sys.obj : error LNK2019: unresolved external symbol [email protected] referenced in function _new_fluid_server_socket 
1>../fluidsynth.dll : fatal error LNK1120: 38 unresolved externals 
3>------ Build started: Project: fluidsynth, Configuration: Release Win32 ------ 
2> fluid_aufile.c 
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\Users\Wildfire\Desktop\fluidsynth-1.1.1\winbuild\fluidsynth\.\Release\fluidsynth.exe) does not match the Linker's OutputFile property value (C:\Users\Wildfire\Desktop\fluidsynth-1.1.1\winbuild\fluidsynth.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile). 
2> fluid_chan.c 
2> fluid_chorus.c 
3> fluidsynth.vcxproj -> C:\Users\Wildfire\Desktop\fluidsynth-1.1.1\winbuild\fluidsynth\.\Release\fluidsynth.exe 
2> fluid_cmd.c 
2> fluid_conv.c 
2> fluid_defsfont.c 
2> fluid_dll.c 
2> fluid_dsound.c 
2> fluid_dsp_float.c 
2> fluid_event.c 
2> fluid_event_queue.c 
2> fluid_filerenderer.c 
2> fluid_gen.c 
2> fluid_hash.c 
2> fluid_list.c 
2> fluid_mdriver.c 
2> fluid_midi.c 
2> fluid_midi_router.c 
2> fluid_mod.c 
2> Generating Code... 
2> Compiling... 
2> fluid_ramsfont.c 
2> fluid_rev.c 
2> fluid_seq.c 
2> fluid_seqbind.c 
2> fluid_settings.c 
2> fluid_synth.c 
2> fluid_sys.c 
2> fluid_tuning.c 
2> fluid_voice.c 
2> fluid_winmidi.c 
2> Generating Code... 
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(1151,5): warning MSB8012: TargetPath(C:\Users\Wildfire\Desktop\fluidsynth-1.1.1\winbuild\fluidsynth_lib\.\Release\fluidsynth_lib.lib) does not match the Library's OutputFile property value (C:\Users\Wildfire\Desktop\fluidsynth-1.1.1\winbuild\fluidsynth_lib.lib). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile). 
2> fluidsynth_lib.vcxproj -> C:\Users\Wildfire\Desktop\fluidsynth-1.1.1\winbuild\fluidsynth_lib\.\Release\fluidsynth_lib.lib 
========== Build: 2 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== 
+0

你有什麼版本的glibc?所有缺失的外部符號都是glibc 2.4和更新的原子/互斥函數。 – birryree 2010-11-23 03:02:20

+0

對不起,我已經通過鏈接項目屬性中的* .lib解決了glib,gthread等問題,剩下的就是winsock庫。我在哪裏下載? – Proyb2 2010-11-23 03:10:56

回答

13

由於您已經解決了大部分問題,並且只是缺少了winsock的東西。

您需要安裝Windows Platform SDK,它會安裝很多庫。在安裝位置的l​​ib目錄中將是文件ws2_32.lib,這是您要鏈接的Winsock2庫。

6

您需要鏈接到ws2_32.lib文件,該文件作爲birryree提到,是一個Winsock2庫。但是,如果你不知道如何聯繫起來,這裏有在this MSDN Thread列出的說明:

在項目屬性:

配置屬性,鏈接,輸入,附加依賴。

然後將ws2_32.lib添加到分號分隔的列表中。