[Winpcap-users] error while compiling programmes in visualstudio.net

Gianluca Varenni gianluca.varenni at cacetech.com
Tue Feb 7 17:35:19 GMT 2006


Hi Ashish,

regarding the remote-ext.h file, you should *not* include that file explicitely, instead you should define the preprocessor directives WPCAP and HAVE_REMOTE in order to have that file automatically included by pcap.h. Including remote-ext.h directly can cause linking problems.

Regarding the typeLoadException, this is generated by the CLR (Common Language Runtime) of .NET. More details on it can be found here:

http://www.mail-archive.com/winpcap-users@winpcap.polito.it/msg02138.html

Have a nice day
GV


  ----- Original Message ----- 
  From: ashish yadav 
  To: winpcap-users at winpcap.org 
  Sent: Monday, February 06, 2006 9:22 PM
  Subject: Re: [Winpcap-users] error while compiling programmes in visualstudio.net


  hi Gianluca..
  sorry for replying soo late..had exams..
  so the code i was using was actually the example given in documentation of winpcap.
  and also the problems regarding pcap_if_src_string not identified and others like this were solved when i used remote-ext.h header file...
  anyway there was a runtime exception....which i couldn't understand hope u can help..
  here is the code i was using..>>>

  #include "pcap.h"
  #include <remote-ext.h>
  main()
  {
      pcap_if_t *alldevs;
      pcap_if_t *d;
      int i=0;
      char errbuf[PCAP_ERRBUF_SIZE];
      
      /* Retrieve the device list from the local machine */
      if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL /* auth is not needed */, &alldevs, errbuf) == -1)
      {
          fprintf(stderr,"Error in pcap_findalldevs_ex: %s\n", errbuf);
          exit(1);
      }
      
      /* Print the list */
      for(d= alldevs; d != NULL; d= d->next)
      {
          printf("%d. %s", ++i, d->name);
          if (d->description)
              printf(" (%s)\n", d->description);
          else
              printf(" (No description available)\n");
      }
      
      if (i == 0)
      {
          printf("\nNo interfaces found! Make sure WinPcap is installed.\n");
          return;
      }

      /* We don't need any more the device list. Free it */
      pcap_freealldevs(alldevs);
  }


  and the error i got was..
  typeload.exception..
  could not load pcap assembly from netmonui(that's the name of my project)..
  if u need any more details jus tell me,,...
  take care..
  ashish


------------------------------------------------------------------------------
  Jiyo cricket on Yahoo! India cricket


------------------------------------------------------------------------------


  _______________________________________________
  Winpcap-users mailing list
  Winpcap-users at winpcap.org
  https://www.winpcap.org/mailman/listinfo/winpcap-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20060207/227b41b7/attachment-0001.htm


More information about the Winpcap-users mailing list