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. "Dynamic Linking of .lib file in my project"

"Dynamic Linking of .lib file in my project"

Scheduled Pinned Locked Moved C / C++ / MFC
question
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.
  • C Offline
    C Offline
    chandni_chandrakant_maheta
    wrote on last edited by
    #1

    I have linked dynamic linked library myfunctions.lib file in my project by setting its path in Project/Settings/Link/Input. And I have to place myfunctions.dll either in the same folder of my project's exe or in the system directory. Can any one suggest me what should do ? if I want to place that myfunctios.dll in some other folder??

    D _ J 3 Replies Last reply
    0
    • C chandni_chandrakant_maheta

      I have linked dynamic linked library myfunctions.lib file in my project by setting its path in Project/Settings/Link/Input. And I have to place myfunctions.dll either in the same folder of my project's exe or in the system directory. Can any one suggest me what should do ? if I want to place that myfunctios.dll in some other folder??

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      chandni_chandrakant_maheta wrote:

      Can any one suggest me what should do ?

      About what?

      chandni_chandrakant_maheta wrote:

      if I want to place that myfunctios.dll in some other folder??

      What other folder?


      "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

      "Judge not by the eye but by the heart." - Native American Proverb

      1 Reply Last reply
      0
      • C chandni_chandrakant_maheta

        I have linked dynamic linked library myfunctions.lib file in my project by setting its path in Project/Settings/Link/Input. And I have to place myfunctions.dll either in the same folder of my project's exe or in the system directory. Can any one suggest me what should do ? if I want to place that myfunctios.dll in some other folder??

        _ Offline
        _ Offline
        _Superman_
        wrote on last edited by
        #3

        Add the folder path into the Additional Include Directories in the project settings.

        « Superman »

        C 1 Reply Last reply
        0
        • C chandni_chandrakant_maheta

          I have linked dynamic linked library myfunctions.lib file in my project by setting its path in Project/Settings/Link/Input. And I have to place myfunctions.dll either in the same folder of my project's exe or in the system directory. Can any one suggest me what should do ? if I want to place that myfunctios.dll in some other folder??

          J Offline
          J Offline
          James R Twine
          wrote on last edited by
          #4

          chandni_chandrakant_maheta wrote:

          And I have to place myfunctions.dll either in the same folder of my project's exe or in the system directory.

          Either one will work normally.  I would suggest in the EXE's local directory, just to make sure you do not mess up any other application that might be using the same DLL (if not an internal DLL) - if you having questions about something like this, dicking around with the Windows/System directory is a bad idea.    Peace!

          -=- James
          Please rate this message - let me know if I helped or not! * * * If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
          Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
          See DeleteFXPFiles

          C 1 Reply Last reply
          0
          • J James R Twine

            chandni_chandrakant_maheta wrote:

            And I have to place myfunctions.dll either in the same folder of my project's exe or in the system directory.

            Either one will work normally.  I would suggest in the EXE's local directory, just to make sure you do not mess up any other application that might be using the same DLL (if not an internal DLL) - if you having questions about something like this, dicking around with the Windows/System directory is a bad idea.    Peace!

            -=- James
            Please rate this message - let me know if I helped or not! * * * If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
            Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
            See DeleteFXPFiles

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

            but my requirement is such that I need to make one folder in my project's exe's path, and I need to place myfunctions.dll in that folder. Doing so, it gives error tha "dll not found" and terminates the application.

            J 1 Reply Last reply
            0
            • _ _Superman_

              Add the folder path into the Additional Include Directories in the project settings.

              « Superman »

              C Offline
              C Offline
              chandni_chandrakant_maheta
              wrote on last edited by
              #6

              I tried out this, but it works in case we want to include lib or header files. In case of dll it does not work. Still it gives me the error that "dll ot found. ReInstalling the application may fix this problem."

              1 Reply Last reply
              0
              • C chandni_chandrakant_maheta

                but my requirement is such that I need to make one folder in my project's exe's path, and I need to place myfunctions.dll in that folder. Doing so, it gives error tha "dll not found" and terminates the application.

                J Offline
                J Offline
                James R Twine
                wrote on last edited by
                #7

                then you will need to explicitly specify the path to that folder.  For example, if your application is in C:\SomePath\ and the folder containing the DLL is called Modules, you will need to pass the complete path to LoadLbrary(...) - C:\SomePath\Modules\MyLibrary.dll.    You can call ::GetModuleFileName(...) (I think) to get the complete path to the Executable, remove the executable name, and append the DLL's subdirectory and name onto it, and you have a complete path to the DLL.    Peace!

                -=- James
                Please rate this message - let me know if I helped or not! * * * If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
                Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
                See DeleteFXPFiles

                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