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. import lib file in VC.Net

import lib file in VC.Net

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++tutorialquestion
7 Posts 3 Posters 1 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.
  • C Offline
    C Offline
    casper234
    wrote on last edited by
    #1

    Hi everybody, i need to import a library file(winmm.lib) into my project using VC++.NET. The way to do that is so different from VC++ 6.0. Does anyone know how to do? Thanks in advance.

    H R 2 Replies Last reply
    0
    • C casper234

      Hi everybody, i need to import a library file(winmm.lib) into my project using VC++.NET. The way to do that is so different from VC++ 6.0. Does anyone know how to do? Thanks in advance.

      H Offline
      H Offline
      HENDRIK R
      wrote on last edited by
      #2

      how about #pragma comment(lib, "winmm.lib") ? that should work on both 6.0 and .NET


      We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve

      C 1 Reply Last reply
      0
      • C casper234

        Hi everybody, i need to import a library file(winmm.lib) into my project using VC++.NET. The way to do that is so different from VC++ 6.0. Does anyone know how to do? Thanks in advance.

        R Offline
        R Offline
        robert_s
        wrote on last edited by
        #3

        In Solution Explorer (left hand side widow). Clik properties/linker/additional Library directcories/ (point to directory where your lib is)

        C 1 Reply Last reply
        0
        • H HENDRIK R

          how about #pragma comment(lib, "winmm.lib") ? that should work on both 6.0 and .NET


          We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve

          C Offline
          C Offline
          casper234
          wrote on last edited by
          #4

          Thanks for your reply, Hendrik, but it didnt work. In VC6.0, i can import it in ProjectSetting\Link Tab, but in .NET - hix, cannot

          H 1 Reply Last reply
          0
          • R robert_s

            In Solution Explorer (left hand side widow). Clik properties/linker/additional Library directcories/ (point to directory where your lib is)

            C Offline
            C Offline
            casper234
            wrote on last edited by
            #5

            yes, but when do that, we've just showed VC++ where to find the library. Where do we put the library name?

            R 1 Reply Last reply
            0
            • C casper234

              Thanks for your reply, Hendrik, but it didnt work. In VC6.0, i can import it in ProjectSetting\Link Tab, but in .NET - hix, cannot

              H Offline
              H Offline
              HENDRIK R
              wrote on last edited by
              #6

              you need to announce the whole path to your library file inside the pragma comment instruction ... #pragma comment(lib, "path_to_lib/libname.lib")


              We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve

              1 Reply Last reply
              0
              • C casper234

                yes, but when do that, we've just showed VC++ where to find the library. Where do we put the library name?

                R Offline
                R Offline
                robert_s
                wrote on last edited by
                #7

                There is no need to write your lib name in project settings. The easy way is to just point to the directory the .lib file is stored or as already mentioned, like normaly you do with .h file ie. #include "test.h" with lib you write : #pragma comment (lib, "test.lib") wherever you use your library. thats it. Make sure you compile your libraries in release mode when creating the .lib Hope this helps :o)

                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