MantisBT - CMake
View Issue Details
0010179CMakeCMakepublic2010-01-22 14:202016-06-10 14:31
Luis Ibanez 
Kitware Robot 
normalmajoralways
closedmoved 
 
 
0010179: Duplicate libraries appearances in link command line
When composing the link line, CMake sometimes end up placing multiple copies of a given library. This results in link-time warnings of the sort:

"ld: warning: duplicate dylib"

(e.g. in Darwin).

ld: warning: duplicate dylib
/.../Slicer3/../Slicer3-lib/VTK-build/bin/libvtkzlib.dylib

This illustrates the problem in a build of Slicer3:
http://www.cdash.org/CDash/viewBuildError.php?type=1&buildid=520807 [^]
No tags attached.
related to 0004810closed Brad King OSX linker fails with too many duplicate -lfoo arguments 
Issue History
2010-01-22 14:21Luis IbanezNew Issue
2010-01-22 14:22Luis IbanezNote Added: 0019275
2010-12-14 17:45David ColeAssigned To => David Cole
2010-12-14 17:45David ColeStatusnew => assigned
2011-02-09 14:26David ColeStatusassigned => backlog
2011-02-09 15:09David ColeAssigned ToDavid Cole =>
2011-10-22 01:18Craig ScottNote Added: 0027611
2012-02-09 10:03Brad KingRelationship addedrelated to 0004810
2013-07-04 23:49Lachlan HethertonNote Added: 0033484
2016-06-10 14:27Kitware RobotNote Added: 0041643
2016-06-10 14:27Kitware RobotStatusbacklog => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:27Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0019275)
Luis Ibanez   
2010-01-22 14:22   
From Brad:

"CMake does a lot of work to follow library dependencies to make sure
everything links. Often this involves duplicating library appearance
on command lines. Generally it is needed for static libraries but
we do it for all libraries because sometimes we do not know whether
a library is static or shared.

This can be addressed, but is non-trivial."
(0027611)
Craig Scott   
2011-10-22 01:18   
Would it not work if, when duplicate libraries are listed on the link command line, just keep the last one and remove all earlier ones? The link dependency order would then still be preserved and the duplicate dylib warnings should be eliminated.
(0033484)
Lachlan Hetherton   
2013-07-04 23:49   
Has there been any progress on this? Or are there any obvious work-arounds?
(0041643)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.