Note that there are some explanatory texts on larger screens.

plurals
  1. POcircular dependencies between dlls with visual studio
    primarykey
    data
    text
    <p>I have a circular dependency between two functions. I would like each of these functions to reside in its own dll. Is it possible to build this with visual studio?</p> <pre><code>foo(int i) { if (i &gt; 0) bar(i -i); } </code></pre> <p>-> should compile into foo.dll</p> <pre><code>bar(int i) { if (i &gt; 0) foo(i - i); } </code></pre> <p>-> should compile into bar.dll</p> <p>I have created two projects in visual studio, one for foo and one for bar. By playing with the 'References' and compiling a few times, I managed to get the dll's that I want. I would like to know however whether visual studio offers a way to do this in a clean way.</p> <p>If foo changes, bar does not need to be recompiled, because I only depend on the signature of bar, not on the implementation of bar. If both dll's have the lib present, I can recompile new functionality into either of the two and the whole system still works.</p> <p>The reason I am trying this is that I have a legacy system with circular dependencies, which is currently statically linked. We want to move towards dll's for various reasons. We don't want to wait until we clean up all the circular dependencies. I was thinking about solutions and tried out some things with gcc on linux and there it is possible to do what I suggest. So you can have two shared libraries that depend on each other and can be built independent of each other.</p> <p>I know that circular dependencies are not a good thing to have, but that is not the discussion I want to have.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload