[CMake] Dealing with circular linker dependencies

David Cole david.cole at kitware.com
Thu Oct 4 14:55:15 EDT 2007


It's also *nearly/totally?* impossible for Windows dll builds, so if
you ever intend to build them as dlls on Windows, rearchitect your
project. Circular library dependencies are best avoided if at all
possible.


On 10/4/07, Juan Sanchez <Juan.Sanchez at amd.com> wrote:
> Aside from rearchitecting your project.  You need to place one library
> on both sides of the other library in the arguments to the linker.
>
> -l A -l B -l A
>
> This assures that the linker can resolve all the needed symbols.
>
> Juan
>
> Tal Blum wrote:
> > I have two c++ libraries each depending on the other which creates a
> > circular linker dependency problem. Does anyone know how to solve this
> > problem? If this is not possible to solve at the command-line level can
> > someone tell me how I can write a ADD_CUSTOM_COMMAND or
> > ADD_CUSTOM_TARGET that will collect all the object files into a new
> > library and make my executable depend on that new library target.
> >
> >
> >
> > Thanks, Tal
> >
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > CMake mailing list
> > CMake at cmake.org
> > http://www.cmake.org/mailman/listinfo/cmake
>
>
> --
> Juan Sanchez
> Juan.Sanchez at amd.com
> 800-538-8450 Ext. 54395
> 512-602-4395
>
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list