简体   繁体   English

在Delphi / C ++ Builder中安装多个库版本

[英]Installing multiple library versions in Delphi / C++Builder

How I can install multiple versions of a library in Delphi or C++Builder? 如何在Delphi或C ++ Builder中安装多个版本的库? For example, I might want to be able to develop the next version of our app using the current versions of JCL and JVCL while still being able to compile the release version of our app using whatever version of JCL and JVCL were tested for that release. 例如,我可能希望能够使用当前版本的JCL和JVCL开发我们的应用程序的下一个版本,同时仍然能够使用针对该版本测试的任何版本的JCL和JVCL来编译我们的应用程序的发行版本。

Using more than one version of a library is easy with libraries like Boost, since those are just header files and library / DLL files that I can put wherever I want, and so I can simply point my project files at the appropriate library directories. 使用Boost这样的库很容易使用多个版本的库,因为这些只是我可以放在任何地方的头文件和库/ DLL文件,所以我可以简单地将我的项目文件指向相应的库目录。 However, since libraries like JCL and JVCL try to install themselves into the IDE, I'm not sure how to configure different projects to use different versions without it turning into an unmanageable hack. 但是,由于像JCL和JVCL这样的库试图将自己安装到IDE中,我不确定如何配置不同的项目以使用不同的版本而不会变成无法管理的黑客。

(I'm still not entirely familiar with how Delphi manages components and projects - most of my experience is in C++ - so this may be part of my problem.) (我还不完全熟悉Delphi如何管理组件和项目 - 我的大多数经验都是用C ++编写的 - 所以这可能是我问题的一部分。)

We had the same problem, supporting older versions compiled with different versions of the components. 我们遇到了同样的问题,支持使用不同版本的组件编译的旧版本。 Our solution was/is to use the IDE's " -r " command line option. 我们的解决方案是使用IDE的“-r”命令行选项。 With this switch it is possible to use different library paths and packages (at the same time). 使用此开关,可以使用不同的库路径和包(同时)。 The only problem that we encountered with this approach was that some of us regularly tried to open an older project version in the wrong IDE instance. 我们在这种方法中遇到的唯一问题是我们中的一些人经常试图在错误的IDE实例中打开一个较旧的项目版本。

[Old version 1.0] bds.exe -rVersion1.0
[trunk version  ] bds.exe

How to setup those: 如何设置:

  1. Start your IDE as you are used to it. 按照您的习惯启动IDE。
  2. Install everything you need for "Version 1.0" 安装“1.0版”所需的一切
  3. Close the IDE 关闭IDE
  4. Install all (old) packages (JCL/JVCL/...) 安装所有(旧)软件包(JCL / JVCL / ...)
  5. Start regedit.exe 启动regedit.exe
  6. Export the registry key HKCU\\Software\\CodeGear\\BDS\\5.0 to a *.reg file 将注册表项HKCU \\ Software \\ CodeGear \\ BDS \\ 5.0导出到* .reg文件
  7. Start nodepad.exe and do a search&replace in the *.reg file for "CodeGear\\BDS\\5.0" and replace it with "CodeGear\\Version1.0\\5.0" 启动nodepad.exe并在* .reg文件中搜索并替换“CodeGear \\ BDS \\ 5.0”并将其替换为“CodeGear \\ Version1.0 \\ 5.0”
  8. Import the *.reg file (by double clicking it in the Windows Explorer) 导入* .reg文件(在Windows资源管理器中双击)
  9. Create a copy of your RAD Studio 2007 startmenu link and change the command line to include the "-rVersion1.0" key. 创建RAD Studio 2007 startmenu链接的副本,并更改​​命令行以包含“-rVersion1.0”密钥。

Now you have two IDE configurations that are equal. 现在您有两个相同的IDE配置。 You can now change the IDE that doesn't use the " -r " command option to your trunk version's packages. 您现在可以将不使用“-r”命令选项的IDE更改为trunk版本的软件包。 When you install all the packages, you must not use the default BPL and DCP directories unless the different package versions use different file names (like the JCL and JVCL do). 安装所有软件包时,除非不同的软件包版本使用不同的文件名(如JCL和JVCL),否则不得使用默认的BPL和DCP目录。

CodeGear\BDS\5.0 = Delphi 2007
CodeGear\BDS\6.0 = Delphi 2009
Borland\BDS\4.0 = Delphi 2006
Borland\Delphi\7.0 = Delphi 7

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM