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. How to include a library file?

How to include a library file?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
7 Posts 4 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.
  • M Offline
    M Offline
    Malini Nair
    wrote on last edited by
    #1

    Hi everybody! I downloaded a project.When I compiled it, I got an error saying 'Cannot open Iphlpapi.lib'. Then i downloaded the library file and included it in the project. Still it shows this error! I dono what has to be done! Please help me! Thanks in advance!

    T N 2 Replies Last reply
    0
    • M Malini Nair

      Hi everybody! I downloaded a project.When I compiled it, I got an error saying 'Cannot open Iphlpapi.lib'. Then i downloaded the library file and included it in the project. Still it shows this error! I dono what has to be done! Please help me! Thanks in advance!

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      you have to tell the linker where to find the .lib file. look in your project settings, and reach the linker "additionnal libraries" option...


      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

      1 Reply Last reply
      0
      • M Malini Nair

        Hi everybody! I downloaded a project.When I compiled it, I got an error saying 'Cannot open Iphlpapi.lib'. Then i downloaded the library file and included it in the project. Still it shows this error! I dono what has to be done! Please help me! Thanks in advance!

        N Offline
        N Offline
        Nibu babu thomas
        wrote on last edited by
        #3

        Do you have the latest platform SDK installed. To include a lib file you can also use... Another option is use #pragma comment( lib, "Iphlpapi.lib" )


        Nibu thomas A Developer Programming tips[^]  My site[^]

        _ 1 Reply Last reply
        0
        • N Nibu babu thomas

          Do you have the latest platform SDK installed. To include a lib file you can also use... Another option is use #pragma comment( lib, "Iphlpapi.lib" )


          Nibu thomas A Developer Programming tips[^]  My site[^]

          _ Offline
          _ Offline
          _8086
          wrote on last edited by
          #4

          Nibu babu thomas wrote:

          #pragma comment( lib, "Iphlpapi.lib" )

          Why is that called "comment" any relavance?:~

          286? WOWW!:-O

          N 1 Reply Last reply
          0
          • _ _8086

            Nibu babu thomas wrote:

            #pragma comment( lib, "Iphlpapi.lib" )

            Why is that called "comment" any relavance?:~

            286? WOWW!:-O

            N Offline
            N Offline
            Nibu babu thomas
            wrote on last edited by
            #5

            _8086 wrote:

            Why is that called "comment" any relavance

            From MSDN: #pragma comment( comment-type [, commentstring] ) Places a comment record into an object file or executable file. The comment-type is one of five predefined identifiers, described below, that specify the type of comment record. The optional commentstring is a string literal that provides additional information for some comment types. Because commentstring is a string literal, it obeys all the rules for string literals with respect to escape characters, embedded quotation marks ("), and concatenation. lib: Places a library-search record in the object file. This comment type must be accompanied by a commentstring parameter containing the name (and possibly the path) of the library that you want the linker to search. Since the library name precedes the default library-search records in the object file, the linker searches for this library just as if you had named it on the command line. You can place multiple library-search records in the same source file; each record appears in the object file in the same order in which it is encountered in the source file.


            Nibu thomas A Developer Programming tips[^]  My site[^]

            _ 1 Reply Last reply
            0
            • N Nibu babu thomas

              _8086 wrote:

              Why is that called "comment" any relavance

              From MSDN: #pragma comment( comment-type [, commentstring] ) Places a comment record into an object file or executable file. The comment-type is one of five predefined identifiers, described below, that specify the type of comment record. The optional commentstring is a string literal that provides additional information for some comment types. Because commentstring is a string literal, it obeys all the rules for string literals with respect to escape characters, embedded quotation marks ("), and concatenation. lib: Places a library-search record in the object file. This comment type must be accompanied by a commentstring parameter containing the name (and possibly the path) of the library that you want the linker to search. Since the library name precedes the default library-search records in the object file, the linker searches for this library just as if you had named it on the command line. You can place multiple library-search records in the same source file; each record appears in the object file in the same order in which it is encountered in the source file.


              Nibu thomas A Developer Programming tips[^]  My site[^]

              _ Offline
              _ Offline
              _8086
              wrote on last edited by
              #6

              Thanks I get it now.

              286? WOWW!:-O

              N 1 Reply Last reply
              0
              • _ _8086

                Thanks I get it now.

                286? WOWW!:-O

                N Offline
                N Offline
                Nibu babu thomas
                wrote on last edited by
                #7

                _8086 wrote:

                Thanks I get it now.

                Really ! :)


                Nibu thomas A Developer Programming tips[^]  My site[^]

                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