Thread: Link error

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    4

    Unhappy Link error

    I linked iphlpapi.lib in link tab option and also pragma comment the file but still get link error LNK1104 cannot open the file iphlpapi.lib
    Do you know how to fix the problem ?
    Thanks a lot inadvance

  2. #2
    C maniac
    Join Date
    Aug 2004
    Location
    Cyberwarping to Middle Earth
    Posts
    154
    Yes. Oviously you don't have the file iphlpapi.lib installed on your system. Try searching google for iphlpapi.lib, or ask if anyone has it. I don't. I don't even know what it is. But I can help.

  3. #3
    C maniac
    Join Date
    Aug 2004
    Location
    Cyberwarping to Middle Earth
    Posts
    154
    From what I've seen, It seems to be a Windows CE module, am I correct?

    [edit]
    Sorry. I can't seem to find a download. See if you can snag an admin or mod. But I'll keep trying.
    [/edit]

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    iewro has the file:
    I linked iphlpapi.lib in link tab option
    [edit]What OS are you using, iewro?[/edit]
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    C maniac
    Join Date
    Aug 2004
    Location
    Cyberwarping to Middle Earth
    Posts
    154
    Quote Originally Posted by dwks
    iewro has the file:


    [edit]What OS are you using, iewro?[/edit]
    Correction: LNK1104 cannot open the file iphlpapi.lib

    Cannot open file. Therefore, he doesn't have the file. That's why I'm searching.

    [edit]Maybe the file isn't in the right directory? And besides, are you using MSVC (MicroSoft Visual C++) or Dev-C++? From what I see on MSDN, you're using MSVC version 6.0 +, am I correct?[/edit]
    Last edited by kawk; 09-27-2005 at 03:36 PM.

  6. #6
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    If iewro managed to link the file in using the "link tab option", it exists, I would imagine. iewro's compiler wouldn't allow it if the file didn't exist.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  7. #7
    C maniac
    Join Date
    Aug 2004
    Location
    Cyberwarping to Middle Earth
    Posts
    154
    Incorrect. You can type in SFHSDJFKSHDNMKTNewwwrhjwe.sdjkf and it will accept it until you try to link. Then you get error LNK1104. Go ahead, try it in MSVC or DEV.

  8. #8
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Is that right? That's not too smart (the compiler, I mean).
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  9. #9
    Registered User
    Join Date
    Sep 2005
    Posts
    4

    Red face

    Thank you for your answers.

    Could you tell me why the following code line fails ?

    DWORD len=sizeof(Adap);
    DWORD status=GetAdaptersInfo(Adap,&len)

    Again thanks

  10. #10
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Is that right? That's not too smart (the compiler, I mean).
    Yes, it's right. The link tab is just a place for you to write in what librarys you want to link to. The linker doesn't actually check for the validity of those files until the link process begins.

  11. #11
    C maniac
    Join Date
    Aug 2004
    Location
    Cyberwarping to Middle Earth
    Posts
    154
    Yes. Or, at least, on my compilers it doesn't check until compiletime. It might be a holdover from the days where your sourcefile & makefile were on diffrent disks than you gcc or tcc or whatever. Anyway. I can't seem to find a download for iphlpapi.lib, but I got a good excercise in searching MSDN. Sorry, iewro.

  12. #12
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Could you tell me why the following code line fails ?
    Explain what you mean by "fails". What error are you getting?

  13. #13
    Registered User
    Join Date
    Sep 2005
    Posts
    4
    Debug error, abnormal program termination.

  14. #14
    C maniac
    Join Date
    Aug 2004
    Location
    Cyberwarping to Middle Earth
    Posts
    154
    Therefore, incorrect parms, passing an unallocated pointer by value, or perhaps no memory left .

    [edit]Here's your problemo:

    Code:
    DWORD status=GetAdaptersInfo(Adap,&len)
    It should be:
    Code:
    DWORD status=GetAdaptersInfo(Adap,len)
    P.S. And maybe len should equal sizeof(structname) rather than sizeof(varname).

    If I'm wrong, please tell me, and I'll look again.
    [/edit]
    Last edited by kawk; 09-27-2005 at 04:11 PM.

  15. #15
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    ... and what did you think reporting it would do exactly? Besides wasting all of the mods time, who will see the mail and look to see if it has been handled... not a good way to go.

    This is a reply to the reporter, not to the thread. S/he knows who that is.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 04:09 AM
  3. Avoiding Global variables
    By csonx_p in forum Windows Programming
    Replies: 32
    Last Post: 05-19-2008, 12:17 AM
  4. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  5. DX - CreateDevice - D3DERR_INVALIDCALL
    By Tonto in forum Game Programming
    Replies: 3
    Last Post: 12-01-2006, 07:17 PM