Lib Errors
-
Recently I downloaded the libnetNT package from eeye.com. I copied all the libs and header files to my directories in msvc, but when I try to build my project I get tons of linker errors. Compiling... arp.cpp Linking... arp : error LNK2001: unresolved external symbol _gethostbyname@4 arp : error LNK2001: unresolved external symbol "int __cdecl libnet_destroy_packet(unsigned char * *)" (?libnet_destroy_packet@@YAHPAPAE@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_close_link_interface(struct libnet_link_int *)" (?libnet_close_link_interface@@YAHPAUlibnet_link_int@@@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_write_link_layer(struct libnet_link_int *,unsigned char const *,unsigned char *,int)" (?libnet_write_link_layer@@YAHPAUlibnet_link_int@@PBEPAEH@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_build_arp(unsigned short,unsigned short,unsigned char,unsigned char,unsigned short,unsigned char *,unsigned char *,unsigned char *,unsigned char *,unsigned char const *,in t,unsigned char *)" (?libnet_build_arp@@YAHGGEEGPAE000PBEH0@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_build_ethernet(unsigned char *,unsigned char *,unsigned short,unsigned char const *,int,unsigned char *)" (?libnet_build_ethernet@@YAHPAE0GPBEH0@Z) arp : error LNK2001: unresolved external symbol "struct libnet_link_int * __cdecl libnet_open_link_interface(char *,char *)" (?libnet_open_link_interface@@YAPAUlibnet_link_int@@PAD0@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_select_device(struct sockaddr_in *,unsigned char * *,unsigned char *)" (?libnet_select_device@@YAHPAUsockaddr_in@@PAPAEPAE@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_init_packet(int,unsigned char * *)" (?libnet_init_packet@@YAHHPAPAE@Z) arp : error LNK2001: unresolved external symbol "unsigned char * __cdecl libnet_win32_get_remote_mac(unsigned long)" (?libnet_win32_get_remote_mac@@YAPAEK@Z) arp : error LNK2001: unresolved external symbol _inet_addr@4 Debug/arp.exe : fatal error LNK1120: 11 unresolved externals Error executing link.exe. arp.exe - 12 error(s), 0 warning(s)
-
Recently I downloaded the libnetNT package from eeye.com. I copied all the libs and header files to my directories in msvc, but when I try to build my project I get tons of linker errors. Compiling... arp.cpp Linking... arp : error LNK2001: unresolved external symbol _gethostbyname@4 arp : error LNK2001: unresolved external symbol "int __cdecl libnet_destroy_packet(unsigned char * *)" (?libnet_destroy_packet@@YAHPAPAE@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_close_link_interface(struct libnet_link_int *)" (?libnet_close_link_interface@@YAHPAUlibnet_link_int@@@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_write_link_layer(struct libnet_link_int *,unsigned char const *,unsigned char *,int)" (?libnet_write_link_layer@@YAHPAUlibnet_link_int@@PBEPAEH@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_build_arp(unsigned short,unsigned short,unsigned char,unsigned char,unsigned short,unsigned char *,unsigned char *,unsigned char *,unsigned char *,unsigned char const *,in t,unsigned char *)" (?libnet_build_arp@@YAHGGEEGPAE000PBEH0@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_build_ethernet(unsigned char *,unsigned char *,unsigned short,unsigned char const *,int,unsigned char *)" (?libnet_build_ethernet@@YAHPAE0GPBEH0@Z) arp : error LNK2001: unresolved external symbol "struct libnet_link_int * __cdecl libnet_open_link_interface(char *,char *)" (?libnet_open_link_interface@@YAPAUlibnet_link_int@@PAD0@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_select_device(struct sockaddr_in *,unsigned char * *,unsigned char *)" (?libnet_select_device@@YAHPAUsockaddr_in@@PAPAEPAE@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_init_packet(int,unsigned char * *)" (?libnet_init_packet@@YAHHPAPAE@Z) arp : error LNK2001: unresolved external symbol "unsigned char * __cdecl libnet_win32_get_remote_mac(unsigned long)" (?libnet_win32_get_remote_mac@@YAPAEK@Z) arp : error LNK2001: unresolved external symbol _inet_addr@4 Debug/arp.exe : fatal error LNK1120: 11 unresolved externals Error executing link.exe. arp.exe - 12 error(s), 0 warning(s)
You don't have to copy the libs to any MSVC directory, instead locate them in the project directory and have them linked with "Add to project". Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
-
You don't have to copy the libs to any MSVC directory, instead locate them in the project directory and have them linked with "Add to project". Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
ok, I just added it to the project and I still get the errors.
-
ok, I just added it to the project and I still get the errors.
Still the same number of errors, or at least some of the unresolved symbols went away? Also, you forgot to link with Winsock. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
-
Recently I downloaded the libnetNT package from eeye.com. I copied all the libs and header files to my directories in msvc, but when I try to build my project I get tons of linker errors. Compiling... arp.cpp Linking... arp : error LNK2001: unresolved external symbol _gethostbyname@4 arp : error LNK2001: unresolved external symbol "int __cdecl libnet_destroy_packet(unsigned char * *)" (?libnet_destroy_packet@@YAHPAPAE@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_close_link_interface(struct libnet_link_int *)" (?libnet_close_link_interface@@YAHPAUlibnet_link_int@@@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_write_link_layer(struct libnet_link_int *,unsigned char const *,unsigned char *,int)" (?libnet_write_link_layer@@YAHPAUlibnet_link_int@@PBEPAEH@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_build_arp(unsigned short,unsigned short,unsigned char,unsigned char,unsigned short,unsigned char *,unsigned char *,unsigned char *,unsigned char *,unsigned char const *,in t,unsigned char *)" (?libnet_build_arp@@YAHGGEEGPAE000PBEH0@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_build_ethernet(unsigned char *,unsigned char *,unsigned short,unsigned char const *,int,unsigned char *)" (?libnet_build_ethernet@@YAHPAE0GPBEH0@Z) arp : error LNK2001: unresolved external symbol "struct libnet_link_int * __cdecl libnet_open_link_interface(char *,char *)" (?libnet_open_link_interface@@YAPAUlibnet_link_int@@PAD0@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_select_device(struct sockaddr_in *,unsigned char * *,unsigned char *)" (?libnet_select_device@@YAHPAUsockaddr_in@@PAPAEPAE@Z) arp : error LNK2001: unresolved external symbol "int __cdecl libnet_init_packet(int,unsigned char * *)" (?libnet_init_packet@@YAHHPAPAE@Z) arp : error LNK2001: unresolved external symbol "unsigned char * __cdecl libnet_win32_get_remote_mac(unsigned long)" (?libnet_win32_get_remote_mac@@YAPAEK@Z) arp : error LNK2001: unresolved external symbol _inet_addr@4 Debug/arp.exe : fatal error LNK1120: 11 unresolved externals Error executing link.exe. arp.exe - 12 error(s), 0 warning(s)
You must (obviously) link with e.g. the socket library you intend to use, and all the other libraries. 1. Check in the MSDN help what library implements "gethostbyname". 2. Add this to the "Link" tab. You'll have to look up what drop-list tab you need to find for the "libraries" edit box. 3. To that same edit box, add the name (possibly including path) to the library or libraries inplementing e.g. libnet_init_packet.
-
You must (obviously) link with e.g. the socket library you intend to use, and all the other libraries. 1. Check in the MSDN help what library implements "gethostbyname". 2. Add this to the "Link" tab. You'll have to look up what drop-list tab you need to find for the "libraries" edit box. 3. To that same edit box, add the name (possibly including path) to the library or libraries inplementing e.g. libnet_init_packet.
ok I just linked with winsock and that reduced the # of errors to ten instead of twelve. Linking... arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_destroy_packet(unsigned char * *)" (?libnet_destroy_packet@@YAHPAPAE@Z) arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_close_link_interface(struct libnet_link_int *)" (?libnet_close_link_interface@@YAHPAUlibnet_link_int@@@Z) arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_write_link_layer(struct libnet_link_int *,unsigned char const *,unsigned char *,int)" (?libnet_write_link_layer@@YAHPAUlibnet_link_int@@PBEPAEH@Z) arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_build_arp(unsigned short,unsigned short,unsigned char,unsigned char,unsigned short,unsigned char *,unsigned char *,unsigned char *,unsigned char *,unsigned char const *,in t,unsigned char *)" (?libnet_build_arp@@YAHGGEEGPAE000PBEH0@Z) arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_build_ethernet(unsigned char *,unsigned char *,unsigned short,unsigned char const *,int,unsigned char *)" (?libnet_build_ethernet@@YAHPAE0GPBEH0@Z) arp.obj : error LNK2001: unresolved external symbol "struct libnet_link_int * __cdecl libnet_open_link_interface(char *,char *)" (?libnet_open_link_interface@@YAPAUlibnet_link_int@@PAD0@Z) arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_select_device(struct sockaddr_in *,unsigned char * *,unsigned char *)" (?libnet_select_device@@YAHPAUsockaddr_in@@PAPAEPAE@Z) arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_init_packet(int,unsigned char * *)" (?libnet_init_packet@@YAHHPAPAE@Z) arp.obj : error LNK2001: unresolved external symbol "unsigned char * __cdecl libnet_win32_get_remote_mac(unsigned long)" (?libnet_win32_get_remote_mac@@YAPAEK@Z) Debug/arp.exe : fatal error LNK1120: 9 unresolved externals Error executing link.exe. arp.exe - 10 error(s), 0 warning(s)
-
ok I just linked with winsock and that reduced the # of errors to ten instead of twelve. Linking... arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_destroy_packet(unsigned char * *)" (?libnet_destroy_packet@@YAHPAPAE@Z) arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_close_link_interface(struct libnet_link_int *)" (?libnet_close_link_interface@@YAHPAUlibnet_link_int@@@Z) arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_write_link_layer(struct libnet_link_int *,unsigned char const *,unsigned char *,int)" (?libnet_write_link_layer@@YAHPAUlibnet_link_int@@PBEPAEH@Z) arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_build_arp(unsigned short,unsigned short,unsigned char,unsigned char,unsigned short,unsigned char *,unsigned char *,unsigned char *,unsigned char *,unsigned char const *,in t,unsigned char *)" (?libnet_build_arp@@YAHGGEEGPAE000PBEH0@Z) arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_build_ethernet(unsigned char *,unsigned char *,unsigned short,unsigned char const *,int,unsigned char *)" (?libnet_build_ethernet@@YAHPAE0GPBEH0@Z) arp.obj : error LNK2001: unresolved external symbol "struct libnet_link_int * __cdecl libnet_open_link_interface(char *,char *)" (?libnet_open_link_interface@@YAPAUlibnet_link_int@@PAD0@Z) arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_select_device(struct sockaddr_in *,unsigned char * *,unsigned char *)" (?libnet_select_device@@YAHPAUsockaddr_in@@PAPAEPAE@Z) arp.obj : error LNK2001: unresolved external symbol "int __cdecl libnet_init_packet(int,unsigned char * *)" (?libnet_init_packet@@YAHHPAPAE@Z) arp.obj : error LNK2001: unresolved external symbol "unsigned char * __cdecl libnet_win32_get_remote_mac(unsigned long)" (?libnet_win32_get_remote_mac@@YAPAEK@Z) Debug/arp.exe : fatal error LNK1120: 9 unresolved externals Error executing link.exe. arp.exe - 10 error(s), 0 warning(s)
I don't understand what's going wrong. I even linked all the libs that Libnet was compiled from.