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 check if a Library file is available to the project or not ?

How to check if a Library file is available to the project or not ?

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestiontutorial
15 Posts 6 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.
  • N Nikhil Trivedi

    Hello All, I have included the directory containing ws2_32.lib to the project in the Library files' directory. Now I am getting LNK2019 error which says that the function I am using from winsock2.h are unresolved externals. So I want to check whether my project is having the ws2_32.lib file available or not ? How can I check ? If someone knows please help me. Thanks for the prompt reply. Nikhs Nikhil Trivedi

    CPalliniC Offline
    CPalliniC Offline
    CPallini
    wrote on last edited by
    #3

    you have to add the library to the linker input libraries (select, in menu Project->Settings, the Link tab, then add the library name in the Project Options list). Hope that helps. :)

    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

    In testa che avete, signor di Ceprano?

    N 1 Reply Last reply
    0
    • N Nikhil Trivedi

      Hello All, I have included the directory containing ws2_32.lib to the project in the Library files' directory. Now I am getting LNK2019 error which says that the function I am using from winsock2.h are unresolved externals. So I want to check whether my project is having the ws2_32.lib file available or not ? How can I check ? If someone knows please help me. Thanks for the prompt reply. Nikhs Nikhil Trivedi

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #4

      If you are using of vs2005 it installed library files(necessary ) on your machine but anyway You can add this code to your source file

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

      Whats your application type?(Console)


      WhiteSky


      N 1 Reply Last reply
      0
      • C Cedric Moonen

        You need also to specify in your project settings that you want to link against this library. This is done in 'Linker' -> 'Input' -> 'Additional Dependencies' (for VS2005).


        Cédric Moonen Software developer
        Charting control [v1.2 - Updated]

        N Offline
        N Offline
        Nikhil Trivedi
        wrote on last edited by
        #5

        I didn't find anywhere Linker option. I am using Visual studio 2005. It is not in Project tab and not even in Tools->options tab where we can add the directory paths Can you tell me where to add the library file in Visual Studio 2005? Thanks for prompt reply. Nikhs Nikhil Trivedi

        C 1 Reply Last reply
        0
        • CPalliniC CPallini

          you have to add the library to the linker input libraries (select, in menu Project->Settings, the Link tab, then add the library name in the Project Options list). Hope that helps. :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

          N Offline
          N Offline
          Nikhil Trivedi
          wrote on last edited by
          #6

          Thanks for your reply. But that is with visual studio 6.0. I know that. But I have just upgraded to Visual studio 2005. Can you tell me how to add the library file in that one ? Thanks for prompt reply. Nikhs Nikhil Trivedi

          CPalliniC 1 Reply Last reply
          0
          • H Hamid Taebi

            If you are using of vs2005 it installed library files(necessary ) on your machine but anyway You can add this code to your source file

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

            Whats your application type?(Console)


            WhiteSky


            N Offline
            N Offline
            Nikhil Trivedi
            wrote on last edited by
            #7

            Thanks. That worked ! Can you just tell me how to add the library file in the project in Visual Studio 2005 ? Thanks for prompt reply. Nikhs Nikhil Trivedi

            H D 2 Replies Last reply
            0
            • N Nikhil Trivedi

              I didn't find anywhere Linker option. I am using Visual studio 2005. It is not in Project tab and not even in Tools->options tab where we can add the directory paths Can you tell me where to add the library file in Visual Studio 2005? Thanks for prompt reply. Nikhs Nikhil Trivedi

              C Offline
              C Offline
              Cedric Moonen
              wrote on last edited by
              #8

              Nikhil Trivedi wrote:

              It is not in Project tab

              Yes it is: you need to have a project opened and then you will have a menu '.... Properties' (where '....' is the name of your project).


              Cédric Moonen Software developer
              Charting control [v1.2 - Updated]

              1 Reply Last reply
              0
              • N Nikhil Trivedi

                Thanks for your reply. But that is with visual studio 6.0. I know that. But I have just upgraded to Visual studio 2005. Can you tell me how to add the library file in that one ? Thanks for prompt reply. Nikhs Nikhil Trivedi

                CPalliniC Offline
                CPalliniC Offline
                CPallini
                wrote on last edited by
                #9

                Yes, that was on VS6. On VS2003 (the one I have), you have to select menu Project->Project properties then the Linker node and finally select Command line and add the library name to additional options list. :) Please note, actually names maybe a bit different, I translated from my version (Italian) one.

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

                In testa che avete, signor di Ceprano?

                M 1 Reply Last reply
                0
                • N Nikhil Trivedi

                  Thanks. That worked ! Can you just tell me how to add the library file in the project in Visual Studio 2005 ? Thanks for prompt reply. Nikhs Nikhil Trivedi

                  H Offline
                  H Offline
                  Hamid Taebi
                  wrote on last edited by
                  #10

                  I think you asked and I answered to you did you see my previous message?


                  WhiteSky


                  1 Reply Last reply
                  0
                  • N Nikhil Trivedi

                    Thanks. That worked ! Can you just tell me how to add the library file in the project in Visual Studio 2005 ? Thanks for prompt reply. Nikhs Nikhil Trivedi

                    D Offline
                    D Offline
                    Dominik Reichl
                    wrote on last edited by
                    #11

                    Go 'Project' -> 'Project Properties' -> open 'Configuration Properties' -> open 'Linker' -> open 'Input' -> add the .lib file to 'Additional Dependencies'.


                    Too many passwords to remember? Try KeePass Password Safe!

                    N H 2 Replies Last reply
                    0
                    • D Dominik Reichl

                      Go 'Project' -> 'Project Properties' -> open 'Configuration Properties' -> open 'Linker' -> open 'Input' -> add the .lib file to 'Additional Dependencies'.


                      Too many passwords to remember? Try KeePass Password Safe!

                      N Offline
                      N Offline
                      Nikhil Trivedi
                      wrote on last edited by
                      #12

                      Thanks. Your answer was perfect. I got it. Thanks to you and all that helped me. Nikhs Nikhil Trivedi

                      1 Reply Last reply
                      0
                      • CPalliniC CPallini

                        Yes, that was on VS6. On VS2003 (the one I have), you have to select menu Project->Project properties then the Linker node and finally select Command line and add the library name to additional options list. :) Please note, actually names maybe a bit different, I translated from my version (Italian) one.

                        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

                        M Offline
                        M Offline
                        Mark Salsbery
                        wrote on last edited by
                        #13

                        CPallini wrote:

                        On VS2003 (the one I have), you have to select menu Project->Project properties then the Linker node and finally select Command line and add the library name to additional options list.

                        Heh :) I add them in Project properties->Linker->Input->Additional Dependencies. The last time I mentioned that, somebody reminded me you can just add it to the tree in solution explorer LOL Cheers, Mark

                        "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

                        CPalliniC 1 Reply Last reply
                        0
                        • M Mark Salsbery

                          CPallini wrote:

                          On VS2003 (the one I have), you have to select menu Project->Project properties then the Linker node and finally select Command line and add the library name to additional options list.

                          Heh :) I add them in Project properties->Linker->Input->Additional Dependencies. The last time I mentioned that, somebody reminded me you can just add it to the tree in solution explorer LOL Cheers, Mark

                          "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

                          CPalliniC Offline
                          CPalliniC Offline
                          CPallini
                          wrote on last edited by
                          #14

                          I didn't know. Wonderful! :-D

                          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

                          In testa che avete, signor di Ceprano?

                          1 Reply Last reply
                          0
                          • D Dominik Reichl

                            Go 'Project' -> 'Project Properties' -> open 'Configuration Properties' -> open 'Linker' -> open 'Input' -> add the .lib file to 'Additional Dependencies'.


                            Too many passwords to remember? Try KeePass Password Safe!

                            H Offline
                            H Offline
                            Hamid Taebi
                            wrote on last edited by
                            #15

                            your answer was step by step :)


                            WhiteSky


                            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