我正在尝试使用VS2005在Windows上构建wpa_supplicant应用程序。当我构建它时,我收到链接错误:
------ Rebuild All started: Project: wpa_cli, Configuration: Release Win32 ------
Deleting intermediate and output files for project 'wpa_cli', configuration 'Release|Win32'
Compiling...
wpa_ctrl.c
wpa_cli.c
os_win32.c
common.c
Linking...
wpa_cli.obj : error LNK2001: unresolved external symbol _eloop_init
wpa_cli.obj : error LNK2001: unresolved external symbol _eloop_unregister_read_sock
wpa_cli.obj : error LNK2001: unresolved external symbol _eloop_register_timeout
wpa_cli.obj : error LNK2001: unresolved external symbol _edit_redraw
wpa_cli.obj : error LNK2001: unresolved external symbol _edit_init
wpa_cli.obj : error LNK2001: unresolved external symbol _eloop_register_read_sock
wpa_cli.obj : error LNK2001: unresolved external symbol _eloop_destroy
wpa_cli.obj : error LNK2001: unresolved external symbol _eloop_terminate
wpa_cli.obj : error LNK2001: unresolved external symbol _eloop_register_signal_terminate
wpa_cli.obj : error LNK2001: unresolved external symbol _eloop_run
wpa_cli.obj : error LNK2001: unresolved external symbol _eloop_cancel_timeout
wpa_cli.obj : error LNK2001: unresolved external symbol _edit_deinit
wpa_cli.obj : error LNK2001: unresolved external symbol _edit_clear_line
D:\Interworking\wpa_supplicant-1.0.tar\wpa_supplicant-1.0\wpa_supplicant-1.0
\wpa_supplicant\vs2005\Release\wpa_cli.exe : fatal error LNK1120: 13 unresolved externals
我已经给出了额外的Include目录,其中eloop_init,eloop_unregister_read_sock等已定义。
答案 0 :(得分:0)
另一个常见问题:
除了附加的include目录(所以你的代码可以编译),你还应该添加链接库(所以你的代码可以链接):它应该在
中项目属性/配置属性/链接器/输入/附加 依赖
在VS2010中,它会像:
其他版本的Visual Studio应该是类似的。