Where should i put dll file(that i use in my project)

后端 未结 5 1538
栀梦
栀梦 2021-02-19 21:16

Im setting up a svn repository and wondering where i should put the dll files.

What Ive currently done is put them in the /bin/debug folder and then link them in my pro

相关标签:
5条回答
  • 2021-02-19 21:31

    We typically have a seperate folder called dlls or something where we keep all 3rd party dlls/assemblies

    0 讨论(0)
  • 2021-02-19 21:33

    I presume you are asking about third party dll files, because the output (exe/dll) files generated by the project are better left unmanaged by SVN, because they are regenerated on each and every build.

    What I usualy do is create a Lib folder, that is on the top level of my source tree, and put all needed references there, usually in additional folder divided by tool or by functionality (logging, emailing, apis, etc, etc...)

    0 讨论(0)
  • 2021-02-19 21:41

    You should not put anything from the bin/Debug or bin/Release in your source control. If you do that, you will lose them when you clean your solution or your projects. What you have to do is create a folder, within the solution folder for example, and reference the dlls in your projects. Any third-party dll that is in the references of a project will be copied to the bin/Debug or bin/Release folder when the project is compiled.

    0 讨论(0)
  • 2021-02-19 21:53

    Dlls are only needed at runtime. For a quick fix, you may copy your dlls in the Debug folder where your .exe file is. This Debug folder is at the same level as the solution .sln file in Visual Studio. Which thing you will have to do each time you start a new project... Debug folder

    A better solution would be to copy all third party dlls, plus all the corresponding .h and .lib files, in 2 folders, say C:\dev\include and C:\dev\lib, and then add these 2 folders to your path environment variable once for all. This way, you'll be able to access them from all your projects, without having to copy them over and over.

    Now, if you want someone to be able to run your project on another computer, you'll need to copy all needed .h, .lib and .dll files in your project in a separate folders that you create, say include and lib again, in your project directory where your own program files are, as mentioned in the previous posts. Project folder

    PS. Sorry, it would not let me upload the 2 screenshots, so click on links.

    0 讨论(0)
  • 2021-02-19 21:54

    I typically put it in a Lib folder within my Visual Studio project solution folder. I would also create sub folders all the way to indicate whether the dll is for a 32 bit or 64 bit build and also which version of Visual Studio was used to build it. So something like this: Lib\WIN32\VC2015\ . Then in the Project Properties of the project, under the Debugging Configuration Property, I set Environment to

    PATH=$(SolutionDir)Lib\WIN32\VC2015;%PATH%

    By doing this, I can have separate dll folders for different project configurations if I want to and also the dll files are in a good place to check into source control as well.

    0 讨论(0)
提交回复
热议问题