Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Lib Errors

Lib Errors

Scheduled Pinned Locked Moved C / C++ / MFC
c++comdebugginghelpquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stupration
    wrote on last edited by
    #1

    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)

    J M 2 Replies Last reply
    0
    • S stupration

      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)

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      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

      S 1 Reply Last reply
      0
      • J Joaquin M Lopez Munoz

        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

        S Offline
        S Offline
        stupration
        wrote on last edited by
        #3

        ok, I just added it to the project and I still get the errors.

        J 1 Reply Last reply
        0
        • S stupration

          ok, I just added it to the project and I still get the errors.

          J Offline
          J Offline
          Joaquin M Lopez Munoz
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • S stupration

            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)

            M Offline
            M Offline
            Mike Nordell
            wrote on last edited by
            #5

            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.

            S 1 Reply Last reply
            0
            • M Mike Nordell

              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.

              S Offline
              S Offline
              stupration
              wrote on last edited by
              #6

              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)

              S 1 Reply Last reply
              0
              • S stupration

                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)

                S Offline
                S Offline
                stupration
                wrote on last edited by
                #7

                I don't understand what's going wrong. I even linked all the libs that Libnet was compiled from.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups