Menu

All i need is a little help from my friends

2002-11-30
2012-09-26
  • Nobody/Anonymous

    GetProcAddress(hndlIcmp,"IcmpCreateFile");
    80 C:\KraftWerk\OBS\OBS\PING.C
    invalid conversion from `void*' to `HINSTANCE__*'

    GetProcAddress(hndlIcmp,"IcmpCloseHandle");
    82 C:\KraftWerk\OBS\OBS\PING.C
    invalid conversion from `void*' to `HINSTANCE__*'

    GetProcAddress(hndlIcmp,"IcmpSendEcho");
    85 C:\KraftWerk\OBS\OBS\PING.C
    invalid conversion from `void*' to `HINSTANCE__*'

    FreeLibrary(hndlIcmp);
    92 C:\KraftWerk\OBS\OBS\PING.C
    invalid conversion from `void*' to `HINSTANCE__*'

    And so on... This output if from GCC 3.2. G2.9.5 says this in each of this errors: "80 C:\KraftWerk\OBS\OBS\PING.C
    "ANSI C++ forbids implicit conversion from `void *' in argument passing"

    Can you please help me figure what im doing wrong here?

     
    • Nobody/Anonymous

      One more thing: ANSI C++? Whats GCC talking about? Its a C project! All the files are .c, the project is a C project, the syntax is not C++ syntax, theres not even one C++ thing in here damnned :|

       
    • Nobody/Anonymous

      Oops i forgot to send you this:

      HANDLE hndlIcmp;
      ...and later...
      hndlIcmp = LoadLibrary("ICMP.DLL");

      If not a handle, what should it be?
         

       
    • Nobody/Anonymous

      It keep getting better and better...switched from HANDLE to HINSTANCE and now my GCC output is:

      PING.o(.text+0x217):PING.C: undefined reference to `WSAStartup@8'
      PING.o(.text+0x24c):PING.C: undefined reference to `WSACleanup@0'
      PING.o(.text+0x25a):PING.C: undefined reference to `inet_addr@4'
      PING.o(.text+0x288):PING.C: undefined reference to `gethostbyaddr@12'
      PING.o(.text+0x2a4):PING.C: undefined reference to `inet_ntoa@4'
      PING.o(.text+0x365):PING.C: undefined reference to `inet_ntoa@4'
      PING.o(.text+0x3d2):PING.C: undefined reference to `WSACleanup@0'
      PING.o(.text+0x41c):PING.C: undefined reference to `gethostbyname@4'
      PING.o(.eh_frame+0x11):PING.C: undefined reference to `__gxx_personality_v0'

       
    • Nobody/Anonymous

      -lws2_32 in linker options

      Kip

       
    • Nobody/Anonymous

      KIP Youre the best ! :) Thanks a lot !

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.