Studio中构建的相互依赖的Dll

Studio中构建的相互依赖的Dll

本文介绍了在Visual Studio中构建的相互依赖的Dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Visual Studio解决方案下构建9个32位Dll。

为了论证,每一个都依赖于所有其他人。换句话说,每一个都从其他8中导入符号并导出由其他每个导入的符号8.



目前我通过2个构建配置来执行此操作。第一个尝试编译和链接所有dll。

所有编译都成功但当然所有链接都失败了。然而,构建为每个DLL输出.exp文件和.lib文件



然后运行第二个配置,再次编译所有内容然后忽略它刚制作的大多数文件并链接libs和导出文件从第一个配置构建实际的Dll。



这是有效的,但它是一个可怕的黑客,需要两倍的时间。



我需要的是一种让Visual Studio为我排序或停止第一次配置试图链接而第二种配置形式浪费时间的方法再次编译所有内容。



大约一年前我在VS论坛上问了一个类似的问题,并被告知这可以通过使用项目依赖项设置来解决。它不能,因为你不能创建循环依赖。



我正在做的与描述 []但是使用Visual Studio。

I am building 9 32bit Dlls under a Visual Studio solution.
For the sake of argument each one of them is dependent on all the others. In other words each one imports symbols from the other 8 and exports symbols imported by each of the other 8.

At the moment I do this by having 2 build configurations. The first tries to compile and link all the dlls.
All the compilations succeed but of course all the linking fails. The build however outputs .exp files and .lib files for each DLL

The second configuration is then run which compiles everything again and then ignores most of the files it's just made and links the libs and export files from the first configuration to build the actually Dlls.

This works but it is a horrible hack and takes twice as long as necessary.

What I need is a way to either get Visual Studio to sort this out for me or to stop the first configuration from trying to link and the second configuration form wasting its time compiling everything again.

I asked a similar question in the VS forum about a year ago and was told that this could be fixed by using the project dependency settings. It can't, as you can't create circular dependencies.

What I'm doing is the same as described here[^] but with Visual Studio.

推荐答案



这篇关于在Visual Studio中构建的相互依赖的Dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 03:01