View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006352CMakeCMakepublic2008-02-15 11:052016-06-10 14:30
ReporterKen Cox 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0006352: after cmake fails creating DLL on windows, 2nd execution succeeds
DescriptionI apologize for creating a duplicate of bug 6308, but I can find no way to comment on that issue, and it isn't clear to me that the nature of the bug has been made clear.

The first time you run cmake, it fails the .exp file specifies a function that does not exist. Yet it creates a .dll anyway and no .lib file. You stated in bug 6308 that it is not an error to create a .dll with no exports. That may well be true, but is orthogonal to this issue. This issue is that it is an error to try to create a dll with exports that are not defined. It appears cmake correctly fails, the first time. The issue is that the second time you run cmake, the .dll file exists and cmake does not attempt to build it again.

One possible fix is to have cmake remove the .dll when it detects that the .dll creation step failed. This is a common idiom in hand-coded makefiles when a target generates two files but depends on only one.
TagsNo tags attached.
Attached Fileszip file icon bug6352.zip [^] (3,279 bytes) 2008-02-15 12:22

 Relationships

  Notes
(0010515)
Bill Hoffman (manager)
2008-02-15 11:09

Pleas provide a small example that shows this problem.
(0010520)
Ken Cox (reporter)
2008-02-15 12:24

To use the attached example:
1. run repro.cmd to create the Makefile
2. run nmake; nmake correctly fails due to the link error LNK2001: unresolved external symbol function_2
3. run nmake; nmake now skips the dll step and fails later due to link error LNK1104: cannot open file 'lib1.lib'
(0010522)
Bill Hoffman (manager)
2008-02-15 13:44

OK, I reproduced:

1. build one:
Scanning dependencies of target lib1
[ 50%] Building C object src/lib1/CMakeFiles/lib1.dir/lib1.obj
lib1.c
Linking C shared library ..\..\lib\lib1.dll
lib1.def : error LNK2001: unresolved external symbol function_2
..\..\lib\lib1.lib : fatal error LNK1120: 1 unresolved externals

2. build two:
[ 50%] Built target lib1
Scanning dependencies of target app
[100%] Building CXX object src/app/CMakeFiles/app.dir/main.obj
main.cpp
Linking CXX executable ..\..\bin\app.exe
LINK : fatal error LNK1104: cannot open file 'lib1.lib'
NMAKE : fatal error U1077: 'C:\PROGRA~1\MID05A~1\VC\bin\cl.exe' : return code '0x2'

Also the VSIDE project keeps trying to build the dll each time.
(0030543)
Brad King (manager)
2012-08-13 10:37

Sending issues I'm not actively working on to the backlog to await someone with time for them.

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it:

 http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer or contributor who has the bandwidth to take it on.
(0041409)
Kitware Robot (administrator)
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.

 Issue History
Date Modified Username Field Change
2008-02-15 11:05 Ken Cox New Issue
2008-02-15 11:09 Bill Hoffman Note Added: 0010515
2008-02-15 11:09 Bill Hoffman Status new => assigned
2008-02-15 11:09 Bill Hoffman Assigned To => Bill Hoffman
2008-02-15 12:22 Ken Cox File Added: bug6352.zip
2008-02-15 12:24 Ken Cox Note Added: 0010520
2008-02-15 13:44 Bill Hoffman Note Added: 0010522
2008-02-15 13:45 Bill Hoffman Assigned To Bill Hoffman => Brad King
2012-08-13 10:37 Brad King Status assigned => backlog
2012-08-13 10:37 Brad King Note Added: 0030543
2016-06-10 14:27 Kitware Robot Note Added: 0041409
2016-06-10 14:27 Kitware Robot Status backlog => resolved
2016-06-10 14:27 Kitware Robot Resolution open => moved
2016-06-10 14:30 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team